# Application Pattern Orchestrator on AWS v1.1.0 Application Pattern Orchestrator on AWS API Documentation # Table of contents - [Attribute](#Attribute) - [Create attribute](#Create-attribute) - [Delete attribute](#Delete-attribute) - [Get attribute details](#Get-attribute-details) - [List attributes](#List-attributes) - [Update attribute](#Update-attribute) - [Pattern](#Pattern) - [Create pattern](#Create-pattern) - [Get pattern details](#Get-pattern-details) - [List patterns](#List-patterns) - [Triggers codepipeline to build failed patterns](#Triggers-codepipeline-to-build-failed-patterns) - [Update pattern's metadata](#Update-pattern's-metadata) - [Subscription](#Subscription) - [Create notification subscription](#Create-notification-subscription) - [Delete notification subscription](#Delete-notification-subscription) - [Get subscription for a pattern and email id](#Get-subscription-for-a-pattern-and-email-id) ___ # Attribute ## Create attribute [Back to top](#top)

Create a new attribute

``` POST /attributes ``` ### Parameters - `Parameter` | Name | Type | Description | |----------|------------|---------------------------------------| | key | `String[1..120]` |

The key of the attribute

_Allowed values: "[0-9a-zA-Z_-]"_ | | value | `String[1..120]` |

The value of the attribute

_Allowed values: "[0-9a-zA-Z_-]"_ | | description | `String[1..1024]` | **optional**

The description of the attribute

| | metadata | `Object` | **optional**

The metadata of the attribute in JSON format. The maximum length is 7000.

| ### Parameters examples `json` - Request-Example: ```json { "key": "hostingConstruct" "value": "Lambda" "description": "The application that is mainly based on AWS Lambda Service", "metadata": { "notes": "Only use it for serverless application" } } ``` ### Success response #### Success response - `Success 201` | Name | Type | Description | |----------|------------|---------------------------------------| | name | `String` |

The name of the attribute

| | description | `String` |

The description of the attribute

| | key | `String` |

The key of the attribute

| | value | `String` |

The value of the attribute

| | metadata | `Object` |

The metadata of the attribute

| | createTime | `String` |

The timestamp when the attribute is created

| | lastUpdateTime | `String` |

The timestamp when the attribute is updated last time

| ### Success response example #### Success response example - `Success-Response:` ```json HTTP/1.1 201 Created { "name": "hostingConstruct:Lambda", "key": "hostingConstruct" "value": "Lambda" "description": "The application that is mainly based on AWS Lambda Service", "metadata": { "notes": "Only use it for serverless application" }, "createTime": "2021-05-17T07:04:24.102Z", "lastUpdateTime": "2021-05-17T07:04:24.102Z" } ``` ### Error response #### Error response - `Error 400 - Bad Request` | Name | Type | Description | |----------|------------|---------------------------------------| | error | `String` |

Error message

| | retryable | `Boolean` |

Indicate if the request can be retryable

| #### Error response - `Error 500 - Internal Server Error` | Name | Type | Description | |----------|------------|---------------------------------------| | error | `String` |

Error message

| | retryable | `Boolean` |

Indicate if the request can be retryable

| ### Error response example #### Error response example - `Error-Response-400` ```json HTTP/1.1 400 Bad Request { "error": "Invalid attribute id. The attribute id must match /^[-\\w]{1,120}:[-\\w]{1,120}$/."", "retryable": false } ``` #### Error response example - `Error-Response-500` ```json HTTP/1.1 500 Internal Server Error { "error": "Connection failure.", "retryable": false } ``` ## Delete attribute [Back to top](#top)

Delete an existing attribute.

``` DELETE /attributes/:id ``` ### Parameters - `Parameter` | Name | Type | Description | |----------|------------|---------------------------------------| | id | `String` |

id or name of the attribute

| ### Success response #### Success response - `Success 200` | Name | Type | Description | |----------|------------|---------------------------------------| | id | `String` |

The id of the deleted attribute

| ### Success response example #### Success response example - `Success-Response:` ```json HTTP/1.1 200 OK { "id": "HOSTINGCONSTRUCT:EC2", } ``` ### Error response #### Error response - `Error 400 - Bad Request` | Name | Type | Description | |----------|------------|---------------------------------------| | error | `String` |

Error message

| | retryable | `Boolean` |

Indicate if the request can be retryable

| #### Error response - `Error 404 - Not Found` | Name | Type | Description | |----------|------------|---------------------------------------| | error | `String` |

Error message

| | retryable | `Boolean` |

Indicate if the request can be retryable

| #### Error response - `Error 500 - Internal Server Error` | Name | Type | Description | |----------|------------|---------------------------------------| | error | `String` |

Error message

| | retryable | `Boolean` |

Indicate if the request can be retryable

| ### Error response example #### Error response example - `Error-Response-400` ```json HTTP/1.1 400 Bad Request { "error": "Invalid attribute id. The attribute id must match /^[-\\w]{1,120}:[-\\w]{1,120}$/."", "retryable": false } ``` #### Error response example - `Error-Response-404` ```json HTTP/1.1 404 Not Found { "error": "Specified item is not found. id: TestKey:TestValue", "retryable": false } ``` #### Error response example - `Error-Response-500` ```json HTTP/1.1 500 Internal Server Error { "error": "Connection failure.", "retryable": false } ``` ## Get attribute details [Back to top](#top)

Get details of an attribute

``` GET /attributes/:id ``` ### Parameters - `Parameter` | Name | Type | Description | |----------|------------|---------------------------------------| | id | `String` |

id or name of the attribute

| ### Success response #### Success response - `Success 200` | Name | Type | Description | |----------|------------|---------------------------------------| | name | `String` |

The name of the attribute.

| | description | `String` |

The description of the attribute

| | key | `String` |

The key of the attribute

| | value | `String` |

The value of the attribute

| | metadata | `Object` |

The metadata of the attribute

| | createTime | `String` |

The timestamp when the attribute is created

| | lastUpdateTime | `String` |

The timestamp when the attribute is updated last time

| ### Success response example #### Success response example - `Success-Response:` ```json HTTP/1.1 200 OK { "name": "hostingConstruct:Lambda", "key": "hostingConstruct" "value": "Lambda" "description": "The pattern that is mainly based on AWS Lambda Service", "metadata": { "notes": "Only use it for serverless patterns" }, "createTime": "2021-05-17T07:04:24.102Z", "lastUpdateTime": "2021-05-17T07:04:24.102Z" } ``` ### Error response #### Error response - `Error 400 - Bad Request` | Name | Type | Description | |----------|------------|---------------------------------------| | error | `String` |

Error message

| | retryable | `Boolean` |

Indicate if the request can be retryable

| #### Error response - `Error 404 - Not Found` | Name | Type | Description | |----------|------------|---------------------------------------| | error | `String` |

Error message

| | retryable | `Boolean` |

Indicate if the request can be retryable

| #### Error response - `Error 500 - Internal Server Error` | Name | Type | Description | |----------|------------|---------------------------------------| | error | `String` |

Error message

| | retryable | `Boolean` |

Indicate if the request can be retryable

| ### Error response example #### Error response example - `Error-Response-400` ```json HTTP/1.1 400 Bad Request { "error": "Invalid attribute id. The attribute id must match /^[-\\w]{1,120}:[-\\w]{1,120}$/."", "retryable": false } ``` #### Error response example - `Error-Response-404` ```json HTTP/1.1 404 Not Found { "error": "Specified item is not found. id: TestKey:TestValue", "retryable": false } ``` #### Error response example - `Error-Response-500` ```json HTTP/1.1 500 Internal Server Error { "error": "Connection failure.", "retryable": false } ``` ## List attributes [Back to top](#top)

List all attributes

``` GET /attributes ``` ### Parameters - `Optional Query Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | key | `String` | **optional**

Specify key name to retrieve attributes that have the given key.

| | maxRow | `Number` | **optional**

Maximum number of rows in the response page

_Default value: 100_
_Allowed values: 1-1000_ | | nextToken | `String` | **optional**

Specify the value of the nextToken field in the last response to get the next page.

| ### Success response #### Success response - `Success 200` | Name | Type | Description | |----------|------------|---------------------------------------| | results | `Object[]` |

results

| | results.name | `String` |

The name of the attribute

| | results.description | `String` |

The description of the attribute

| | results.key | `String` |

The key of the attribute

| | results.value | `String` |

The value of the attribute

| | results.metadata | `Object` |

The metadata of the attribute

| | results.createTime | `String` |

The timestamp when the attribute is created

| | results.lastUpdateTime | `String` |

The timestamp when the attribute is updated last time

| | nextToken | `UUID` | **optional**

The token for retrieving next page

| ### Success response example #### Success response example - `Success-Response:` ```json HTTP/1.1 200 OK { "results": [ { "name": "hostingConstruct:Lambda", "key": "hostingConstruct" "value": "Lambda" "description": "The pattern that is mainly based on AWS Lambda Service", "metadata": { "notes": "Only use it for serverless pattern" }, "createTime": "2021-05-17T07:04:24.102Z", "lastUpdateTime": "2021-05-17T07:04:24.102Z" }, { "name": "hostingConstruct:EC2", "key": "hostingConstruct" "value": "EC2" "description": "The pattern that is mainly based on AWS EC2", "metadata": { "notes": "Only use it for pattern that requires linux OS" }, "createTime": "2021-05-17T07:04:24.102Z", "lastUpdateTime": "2021-05-17T07:04:24.102Z" }, ], "nextToken": "5f55c3f4-792e-4ae0-a7a5-76541f8d5ebb" } ``` ### Error response #### Error response - `Error 400 - Bad Request` | Name | Type | Description | |----------|------------|---------------------------------------| | error | `String` |

Error message

| | retryable | `Boolean` |

Indicate if the request can be retryable

| #### Error response - `Error 500 - Internal Server Error` | Name | Type | Description | |----------|------------|---------------------------------------| | error | `String` |

Error message

| | retryable | `Boolean` |

Indicate if the request can be retryable

| ### Error response example #### Error response example - `Error-Response-400` ```json HTTP/1.1 400 Bad Request { "error": "Invalid attribute id. The attribute id must match /^[-\\w]{1,120}:[-\\w]{1,120}$/."", "retryable": false } ``` #### Error response example - `Error-Response-500` ```json HTTP/1.1 500 Internal Server Error { "error": "Connection failure.", "retryable": false } ``` ## Update attribute [Back to top](#top)

Update an existing attribute. This will replace the current attribute entirly, so all parameters need to be specified.

``` PUT /attributes/:id ``` ### Parameters - `Parameter` | Name | Type | Description | |----------|------------|---------------------------------------| | key | `String[1..120]` |

The key of the attribute

_Allowed values: "[0-9a-zA-Z_-]"_ | | value | `String[1..120]` |

The value of the attribute

_Allowed values: "[0-9a-zA-Z_-]"_ | | description | `String[1..1024]` | **optional**

The description of the attribute

| | metadata | `Object` | **optional**

The metadata of the attribute in JSON format. The maximum length is 7000.

| ### Parameters examples `json` - Request-Example: ```json { "key": "hostingConstruct" "value": "Lambda" "description": "The application that is mainly based on AWS Lambda Service", "metadata": { "notes": "Only use it for serverless application" } } ``` ### Success response #### Success response - `Success 200` | Name | Type | Description | |----------|------------|---------------------------------------| | name | `String` |

The name of the attribute

| | description | `String` |

The description of the attribute

| | key | `String` |

The key of the attribute

| | value | `String` |

The value of the attribute

| | metadata | `Object` |

The metadata of the attribute

| | createTime | `String` |

The timestamp when the attribute is created

| | lastUpdateTime | `String` |

The timestamp when the attribute is updated last time

| ### Success response example #### Success response example - `Success-Response:` ```json HTTP/1.1 200 OK { "name": "hostingConstruct:Lambda", "key": "hostingConstruct" "value": "Lambda" "description": "The application that is mainly based on AWS Lambda Service", "metadata": { "notes": "Only use it for serverless application" }, "createTime": "2021-05-17T07:04:24.102Z", "lastUpdateTime": "2021-05-17T07:04:24.102Z" } ``` ### Error response #### Error response - `Error 400 - Bad Request` | Name | Type | Description | |----------|------------|---------------------------------------| | error | `String` |

Error message

| | retryable | `Boolean` |

Indicate if the request can be retryable

| #### Error response - `Error 404 - Not Found` | Name | Type | Description | |----------|------------|---------------------------------------| | error | `String` |

Error message

| | retryable | `Boolean` |

Indicate if the request can be retryable

| #### Error response - `Error 500 - Internal Server Error` | Name | Type | Description | |----------|------------|---------------------------------------| | error | `String` |

Error message

| | retryable | `Boolean` |

Indicate if the request can be retryable

| ### Error response example #### Error response example - `Error-Response-400` ```json HTTP/1.1 400 Bad Request { "error": "Invalid attribute id. The attribute id must match /^[-\\w]{1,120}:[-\\w]{1,120}$/."", "retryable": false } ``` #### Error response example - `Error-Response-404` ```json HTTP/1.1 404 Not Found { "error": "Specified item is not found. id: TestKey:TestValue", "retryable": false } ``` #### Error response example - `Error-Response-500` ```json HTTP/1.1 500 Internal Server Error { "error": "Connection failure.", "retryable": false } ``` # Pattern ## Create pattern [Back to top](#top)

Creates new pattern

``` POST /patterns ``` ### Parameters - `RequestBody` | Name | Type | Description | |----------|------------|---------------------------------------| | name | `String` |

Pattern's Name

| | description | `String` |

Pattern's Description

| | patternType | `String` |

Pattern Type i.e. CDK or CFN

| | attributes | `Object` |

JSON Object

| ### Success response example #### Success response example - `Success-Response:` ```json HTTP/1.1 201 Created API Headers {"Access-Control-Allow-Origin":"*","X-Amzn-Trace-Id":"Root=1-6168f480-0bd8024e6ceb2ff2602efa94;Sampled=1","Content-Type":"application/json"} { "patternObject": { "patternId": "sample-pattern1", "name": "sample-pattern1", "description": "test pattern", "patternType": "CFN", "updatedTimestamp": "2022-09-16T07:01:02.145Z", "createdTimestamp": "2022-09-16T07:01:02.145Z", "infrastructureStackStatus": "CREATE_IN_PROGRESS", "patternRepoURL": "git://dev.github-enterprise.abc/enterprise/sample-pattern1.git", "attributes": { "DataClassification": "PII", "SecurityLevel": "Medium" }, "codeRepository": { "branchName": "master", "repoName": "sample-pattern1" } } } ``` ## Get pattern details [Back to top](#top)

Get pattern details

``` GET /patterns/{id} ``` ### Success response example #### Success response example - `Success-Response:` ```json HTTP/1.1 200 OK { "metadata": { "codeRepository": { "branchName": "master", "type": "github", "repoOwner": "enterprise", "repoName": "sample-pattern" }, "updatedTimestamp": "2022-09-16T06:34:33.648Z", "lastCommitId": "5291a66986299b60536e1d944a82f6edaa88287e", "attributes": { "DataClassification": "PII", "SecurityLevel": "Medium" }, "patternType": "CFN", "description": "test decription", "name": "sample-pattern", "createdTimestamp": "2022-09-16T04:17:10.656Z", "patternRepoURL": "git://dev.github-enterprise.abc/enterprise/sample-pattern.git", "infrastructureStackStatus": "CREATE_COMPLETE", "patternId": "sample-pattern" }, "lastCommitPublishData": { "allPackages": [ { "name": "@sample-pattern/dynamodb-pattern", "version": "1.0.2" } ], "updatedTimestamp": "2022-09-16T06:34:33.648Z", "changedPackages": [ { "name": "@sample-pattern/dynamodb-pattern", "version": "1.0.2" } ], "artifacts": [ { "type": "CONTROL", "name": "cfn_nag.txt", "location": "sample-pattern/5291a66986299b60536e1d944a82f6edaa88287e/controls/cfn_nag.txt" }, { "type": "MARKDOWN", "name": "README.md", "location": "sample-pattern/5291a66986299b60536e1d944a82f6edaa88287e/markdown/README.md" } ], "serviceCatalogProducts": [ { "name": "sample-pattern_@sample-pattern/dynamodb-pattern", "region": "ap-southeast-2", "productId": "prod-otgvptp6uh6nc", "account": "111111111111", "provisioningArtifactId": "pa-y6vhyv6t6j4aa" } ], "commitMessage": "Merge pull request #2 from enterprise/feature initial commit", "createdTimestamp": "2022-09-16T06:34:33.648Z", "commitId": "5291a66986299b60536e1d944a82f6edaa88287e", "patternId": "sample-pattern" } } ``` ## List patterns [Back to top](#top)

List all patterns

``` GET /patterns ``` ### Success response example #### Success response example - `Success-Response:` ```json HTTP/1.1 200 OK { "results": [ { "patternMetaData": { "codeRepository": { "branchName": "master", "type": "github", "repoOwner": "enterprise", "repoName": "sample-pattern" }, "updatedTimestamp": "2022-09-16T06:34:33.648Z", "lastCommitId": "5291a66986299b60536e1d944a82f6edaa88287e", "attributes": { "DataClassification": "PII", "SecurityLevel": "Medium" }, "patternType": "CFN", "description": "decription", "name": "sample-pattern", "createdTimestamp": "2022-09-16T04:17:10.656Z", "patternRepoURL": "git://dev.github-enterprise.abc/enterprise/sample-pattern.git", "infrastructureStackStatus": "CREATE_COMPLETE", "patternId": "sample-pattern" }, "lastCommitPublishData": { "allPackages": [ { "name": "@my-cfn/dynamodb", "version": "1.0.2" } ], "updatedTimestamp": "2022-10-25T02:53:14.535Z", "changedPackages": [ { "name": "@my-cfn/dynamodb", "version": "1.0.2" } ], "artifacts": [ { "type": "CONTROL", "name": "cfn_nag.txt", "location": "sample-pattern/29c26261aa732dd9851258c89a6c375af7cf3d0d/controls/cfn_nag.txt" }, { "type": "IMAGE", "name": "architecture.png", "location": "sample-pattern/29c26261aa732dd9851258c89a6c375af7cf3d0d/images/architecture.png" }, { "type": "MARKDOWN", "name": "README.md", "location": "sample-pattern/29c26261aa732dd9851258c89a6c375af7cf3d0d/markdown/README.md" }, { "type": "MARKDOWN", "name": "USAGE.md", "location": "sample-pattern/29c26261aa732dd9851258c89a6c375af7cf3d0d/markdown/USAGE.md" } ], "serviceCatalogProducts": [ { "name": "sample-pattern_@my-cfn/dynamodb", "region": "ap-southeast-2", "productId": "prod-42323232dsd", "account": "xxxxxxxxxxxx", "provisioningArtifactId": "pa-1111aaaassss" } ], "commitMessage": "Merge pull request #1 from test/feature new templates added", "createdTimestamp": "2022-10-25T02:53:14.535Z", "commitId": "29c26261aa732dd9851258c89a6c375af7cf3d0d", "patternId": "sample-pattern" } } ] } ``` ## Triggers codepipeline to build failed patterns [Back to top](#top)

Triggers codepipeline to build failed patterns

``` PUT /patterns/pipeline/{id} ``` ### Parameters - `RequestBody` | Name | Type | Description | |----------|------------|---------------------------------------| | id | `String` |

Pattern's name

| ### Success response example #### Success response example - `Success-Response:` ```json HTTP/1.1 201 Created API Headers {"Access-Control-Allow-Origin":"*","X-Amzn-Trace-Id":"Root=1-6168f480-0bd8024e6ceb2ff2602efa94;Sampled=1","Content-Type":"application/json"} { "codeRepository": { "branchName": "master", "type": "github", "repoOwner": "enterprise", "repoName": "sample-pattern" }, "updatedTimestamp": "2022-09-16T06:25:59.256Z", "attributes": { "DataClassification": "PII" }, "patternType": "CFN", "description": "", "createdTimestamp": "2022-09-16T06:25:59.256Z", "name": "sample-pattern", "patternRepoURL": "git://dev.github-enterprise.abc/enterprise/sample-pattern.git", "infrastructureStackStatus": "CREATE_IN_PROGRESS", "patternId": "sample-pattern" } ``` ## Update pattern's metadata [Back to top](#top)

Update pattern's metadata

``` PUT /patterns/:id ``` ### Parameters - `RequestBody` | Name | Type | Description | |----------|------------|---------------------------------------| | description | `String` |

Pattern's Description

| | attributes | `Object` |

JSON Object

| ### Success response example #### Success response example - `Success-Response:` ```json HTTP/1.1 200 OK API Headers {"Access-Control-Allow-Origin":"*","X-Amzn-Trace-Id":"Root=1-6168f480-0bd8024e6ceb2ff2602efa94;Sampled=1","Content-Type":"application/json"} { "patternObject": { "patternId": "sample-pattern1", "name": "sample-pattern1", "description": "test pattern", "patternType": "CFN", "updatedTimestamp": "2022-09-16T07:01:02.145Z", "createdTimestamp": "2022-09-16T07:01:02.145Z", "infrastructureStackStatus": "CREATE_IN_PROGRESS", "patternRepoURL": "git://dev.github-enterprise.abc/enterprise/sample-pattern1.git", "attributes": { "DataClassification": "PII", "SecurityLevel": "Medium" }, "codeRepository": { "type": "github", "repoOwner": "enterprise", "branchName": "master", "repoName": "sample-pattern1" } } } ``` # Subscription ## Create notification subscription [Back to top](#top)

Creates a new notification subscription

``` POST /subscriptions ``` ### Parameters - `Parameter` | Name | Type | Description | |----------|------------|---------------------------------------| | patternId | `UUID` |

The pattern's id.

| | email | `String` |

The subscription destination email address.

| ### Error response #### Error response - `Error 400 - Bad Request` | Name | Type | Description | |----------|------------|---------------------------------------| | error | `String` |

Error message

| | retryable | `Boolean` |

Indicate if the request can be retryable

| #### Error response - `Error 500 - Internal Server Error` | Name | Type | Description | |----------|------------|---------------------------------------| | error | `String` |

Error message

| | retryable | `Boolean` |

Indicate if the request can be retryable

| ### Error response example #### Error response example - `Error-Response-400` ```json HTTP/1.1 400 Bad Request { "error": "Invalid attribute id. The attribute id must match /^[-\\w]{1,120}:[-\\w]{1,120}$/."", "retryable": false } ``` #### Error response example - `Error-Response-500` ```json HTTP/1.1 500 Internal Server Error { "error": "Connection failure.", "retryable": false } ``` ## Delete notification subscription [Back to top](#top)

Deletes a notification subscription

``` DELETE /subscriptions ``` ### Parameters - `Parameter` | Name | Type | Description | |----------|------------|---------------------------------------| | patternId | `UUID` |

The pattern's id.

| | email | `String` |

The subscription destination email address.

| ### Error response #### Error response - `Error 400 - Bad Request` | Name | Type | Description | |----------|------------|---------------------------------------| | error | `String` |

Error message

| | retryable | `Boolean` |

Indicate if the request can be retryable

| #### Error response - `Error 500 - Internal Server Error` | Name | Type | Description | |----------|------------|---------------------------------------| | error | `String` |

Error message

| | retryable | `Boolean` |

Indicate if the request can be retryable

| ### Error response example #### Error response example - `Error-Response-400` ```json HTTP/1.1 400 Bad Request { "error": "Invalid attribute id. The attribute id must match /^[-\\w]{1,120}:[-\\w]{1,120}$/."", "retryable": false } ``` #### Error response example - `Error-Response-500` ```json HTTP/1.1 500 Internal Server Error { "error": "Connection failure.", "retryable": false } ``` ## Get subscription for a pattern and email id [Back to top](#top)

Returns subscription data for a pattern and email id

``` GET /subscriptions ``` ### Parameters - `Query string` | Name | Type | Description | |----------|------------|---------------------------------------| | patternId | `String` |

Pattern Id

| | email | `String` |

Subscriber's email address

| ### Success response example #### Success response example - `Success-Response:` ```json HTTP/1.1 200 OK { "email": "test@testdomain.com", "patternId": "test-pattern-id" } ```