id
stringlengths 8
78
| source
stringclasses 743
values | chunk_id
int64 1
5.05k
| text
stringlengths 593
49.7k
|
---|---|---|---|
api-reference-014 | api-reference.pdf | 14 | DELETING | DELETED | DELETE_FAILED Errors For information about the errors that are common to all actions, see Common Errors. CreateKxScalingGroup 65 Management API Reference Amazon FinSpace AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 LimitExceededException A service limit or quota is exceeded. HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 CreateKxScalingGroup 66 Amazon FinSpace See Also Management API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 CreateKxScalingGroup 67 Amazon FinSpace CreateKxUser Management API Reference Creates a user in FinSpace kdb environment with an associated IAM role. Request Syntax POST /kx/environments/environmentId/users HTTP/1.1 Content-type: application/json { "clientToken": "string", "iamRole": "string", "tags": { "string" : "string" }, "userName": "string" } URI Request Parameters The request uses the following URI parameters. environmentId A unique identifier for the kdb environment where you want to create a user. Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: Yes Request Body The request accepts the following data in JSON format. iamRole The IAM role ARN that will be associated with the user. Type: String CreateKxUser 68 Amazon FinSpace Management API Reference Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws[a-z\-]*:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+$ Required: Yes userName A unique identifier for the user. Type: String Length Constraints: Minimum length of 1. Maximum length of 50. Pattern: ^[0-9A-Za-z_-]{1,50}$ Required: Yes clientToken A token that ensures idempotency. This token expires in 10 minutes. Type: String Length Constraints: Minimum length of 1. Maximum length of 36. Pattern: .*\S.* Required: No tags A list of key-value pairs to label the user. You can add up to 50 tags to a user. Type: String to string map Map Entries: Maximum number of 50 items. Key Length Constraints: Minimum length of 1. Maximum length of 128. Key Pattern: ^(?!aws:)[a-zA-Z+-=._:/]+$ Value Length Constraints: Minimum length of 1. Maximum length of 256. Value Pattern: ^[a-zA-Z0-9+-=._:@ ]+$ Required: No CreateKxUser 69 Management API Reference Amazon FinSpace Response Syntax HTTP/1.1 200 Content-type: application/json { "environmentId": "string", "iamRole": "string", "userArn": "string", "userName": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. environmentId A unique identifier for the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ iamRole The IAM role ARN that will be associated with the user. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws[a-z\-]*:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+$ userArn The Amazon Resource Name (ARN) that identifies the user. For more information about ARNs and how to use ARNs in policies, see IAM Identifiers in the IAM User Guide. Type: String CreateKxUser 70 Amazon FinSpace Management API Reference Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\d+:kxEnvironment/[0-9A- Za-z_-]{1,128}/kxUser/[0-9A-Za-z_-]{1,128}$ userName A unique identifier for the user. Type: String Length Constraints: Minimum length of 1. Maximum length of 50. Pattern: ^[0-9A-Za-z_-]{1,50}$ Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 LimitExceededException A service limit or quota is exceeded. HTTP Status Code: 400 ResourceAlreadyExistsException The specified resource group already exists. CreateKxUser 71 Management API Reference Amazon FinSpace HTTP Status Code: 409 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface |
api-reference-015 | api-reference.pdf | 15 | HTTP Status Code: 500 LimitExceededException A service limit or quota is exceeded. HTTP Status Code: 400 ResourceAlreadyExistsException The specified resource group already exists. CreateKxUser 71 Management API Reference Amazon FinSpace HTTP Status Code: 409 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 CreateKxUser 72 Amazon FinSpace CreateKxVolume Management API Reference Creates a new volume with a specific amount of throughput and storage capacity. Request Syntax POST /kx/environments/environmentId/kxvolumes HTTP/1.1 Content-type: application/json { "availabilityZoneIds": [ "string" ], "azMode": "string", "clientToken": "string", "description": "string", "nas1Configuration": { "size": number, "type": "string" }, "tags": { "string" : "string" }, "volumeName": "string", "volumeType": "string" } URI Request Parameters The request uses the following URI parameters. environmentId A unique identifier for the kdb environment, whose clusters can attach to the volume. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ Required: Yes Request Body The request accepts the following data in JSON format. CreateKxVolume 73 Management API Reference Amazon FinSpace availabilityZoneIds The identifier of the availability zones. Type: Array of strings Length Constraints: Minimum length of 8. Maximum length of 12. Pattern: ^[a-zA-Z0-9-]+$ Required: Yes azMode The number of availability zones you want to assign per volume. Currently, FinSpace only supports SINGLE for volumes. This places dataview in a single AZ. Type: String Valid Values: SINGLE | MULTI Required: Yes volumeName A unique identifier for the volume. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes volumeType The type of file system volume. Currently, FinSpace only supports NAS_1 volume type. When you select NAS_1 volume type, you must also provide nas1Configuration. Type: String Valid Values: NAS_1 Required: Yes CreateKxVolume 74 Amazon FinSpace clientToken Management API Reference A token that ensures idempotency. This token expires in 10 minutes. Type: String Length Constraints: Minimum length of 1. Maximum length of 36. Pattern: .*\S.* Required: No description A description of the volume. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ Required: No nas1Configuration Specifies the configuration for the Network attached storage (NAS_1) file system volume. This parameter is required when you choose volumeType as NAS_1. Type: KxNAS1Configuration object Required: No tags A list of key-value pairs to label the volume. You can add up to 50 tags to a volume. Type: String to string map Map Entries: Maximum number of 50 items. Key Length Constraints: Minimum length of 1. Maximum length of 128. Key Pattern: ^(?!aws:)[a-zA-Z+-=._:/]+$ CreateKxVolume 75 Amazon FinSpace Management API Reference Value Length Constraints: Minimum length of 1. Maximum length of 256. Value Pattern: ^[a-zA-Z0-9+-=._:@ ]+$ Required: No Response Syntax HTTP/1.1 200 Content-type: application/json { "availabilityZoneIds": [ "string" ], "azMode": "string", "createdTimestamp": number, "description": "string", "environmentId": "string", "nas1Configuration": { "size": number, "type": "string" }, "status": "string", "statusReason": "string", "volumeArn": "string", "volumeName": "string", "volumeType": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. availabilityZoneIds The identifier of the availability zones. Type: Array of strings Length Constraints: Minimum length of 8. Maximum length of 12. Pattern: ^[a-zA-Z0-9-]+$ CreateKxVolume 76 Amazon FinSpace azMode Management API Reference The number of availability zones you want to assign per volume. Currently, FinSpace only supports SINGLE for volumes. This places dataview in a single AZ. Type: String Valid Values: SINGLE | MULTI createdTimestamp The timestamp at which the volume was created in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp description A description of the volume. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ environmentId A unique identifier for the kdb environment, whose clusters can attach to the volume. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ nas1Configuration Specifies the configuration for the Network attached storage (NAS_1) file system volume. Type: KxNAS1Configuration object status The status of volume creation. CreateKxVolume 77 Amazon FinSpace Management API Reference • CREATING – The volume creation is in progress. • CREATE_FAILED – The volume creation has failed. • ACTIVE – The volume |
api-reference-016 | api-reference.pdf | 16 | A description of the volume. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ environmentId A unique identifier for the kdb environment, whose clusters can attach to the volume. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ nas1Configuration Specifies the configuration for the Network attached storage (NAS_1) file system volume. Type: KxNAS1Configuration object status The status of volume creation. CreateKxVolume 77 Amazon FinSpace Management API Reference • CREATING – The volume creation is in progress. • CREATE_FAILED – The volume creation has failed. • ACTIVE – The volume is active. • UPDATING – The volume is in the process of being updated. • UPDATE_FAILED – The update action failed. • UPDATED – The volume is successfully updated. • DELETING – The volume is in the process of being deleted. • DELETE_FAILED – The system failed to delete the volume. • DELETED – The volume is successfully deleted. Type: String Valid Values: CREATING | CREATE_FAILED | ACTIVE | UPDATING | UPDATED | UPDATE_FAILED | DELETING | DELETED | DELETE_FAILED statusReason The error message when a failed state occurs. Type: String Length Constraints: Minimum length of 1. Maximum length of 250. Pattern: ^[a-zA-Z0-9\_\-\.\s]+$ volumeArn The ARN identifier of the volume. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\d+:kxEnvironment/[0-9A- Za-z_-]{1,128}(/kxSharedVolume/[a-zA-Z0-9_-]{1,255})?$ volumeName A unique identifier for the volume. Type: String CreateKxVolume 78 Amazon FinSpace Management API Reference Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ volumeType The type of file system volume. Currently, FinSpace only supports NAS_1 volume type. Type: String Valid Values: NAS_1 Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 LimitExceededException A service limit or quota is exceeded. HTTP Status Code: 400 CreateKxVolume 79 Amazon FinSpace Management API Reference ResourceAlreadyExistsException The specified resource group already exists. HTTP Status Code: 409 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 CreateKxVolume 80 Management API Reference Amazon FinSpace DeleteEnvironment Delete an FinSpace environment. Request Syntax DELETE /environment/environmentId HTTP/1.1 URI Request Parameters The request uses the following URI parameters. environmentId The identifier for the FinSpace environment. Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: Yes Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Response Elements If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. DeleteEnvironment 81 Amazon FinSpace HTTP Status Code: 403 InternalServerException Management API Reference The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 DeleteEnvironment 82 Amazon FinSpace Management API Reference DeleteEnvironment 83 Amazon FinSpace DeleteKxCluster Deletes a kdb cluster. Request Syntax Management API Reference DELETE /kx/environments/environmentId/clusters/clusterName?clientToken=clientToken HTTP/1.1 URI Request Parameters The request uses the following URI parameters. clientToken A token that ensures idempotency. This token expires in 10 minutes. Length Constraints: |
api-reference-017 | api-reference.pdf | 17 | Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 DeleteEnvironment 82 Amazon FinSpace Management API Reference DeleteEnvironment 83 Amazon FinSpace DeleteKxCluster Deletes a kdb cluster. Request Syntax Management API Reference DELETE /kx/environments/environmentId/clusters/clusterName?clientToken=clientToken HTTP/1.1 URI Request Parameters The request uses the following URI parameters. clientToken A token that ensures idempotency. This token expires in 10 minutes. Length Constraints: Minimum length of 1. Maximum length of 64. Pattern: ^[a-zA-Z0-9-]+$ clusterName The name of the cluster that you want to delete. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ Required: Yes Request Body The request does not have a request body. DeleteKxCluster 84 Amazon FinSpace Response Syntax HTTP/1.1 200 Response Elements Management API Reference If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 LimitExceededException A service limit or quota is exceeded. HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. DeleteKxCluster 85 Amazon FinSpace HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. Management API Reference HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 DeleteKxCluster 86 Amazon FinSpace Management API Reference DeleteKxClusterNode Deletes the specified nodes from a cluster. Request Syntax DELETE /kx/environments/environmentId/clusters/clusterName/nodes/nodeId HTTP/1.1 URI Request Parameters The request uses the following URI parameters. clusterName The name of the cluster, for which you want to delete the nodes. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ Required: Yes nodeId A unique identifier for the node that you want to delete. Length Constraints: Minimum length of 1. Maximum length of 40. Required: Yes Request Body The request does not have a request body. DeleteKxClusterNode 87 Amazon FinSpace Response Syntax HTTP/1.1 200 Response Elements Management API Reference If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: DeleteKxClusterNode 88 Amazon FinSpace Management API Reference • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 DeleteKxClusterNode 89 Amazon FinSpace DeleteKxDatabase Management API Reference Deletes the specified database and all of its associated data. This action is irreversible. You must copy any data out of the database before deleting it if the data is to be retained. Request Syntax DELETE /kx/environments/environmentId/databases/databaseName?clientToken=clientToken HTTP/1.1 URI Request Parameters The request uses the following URI parameters. clientToken A token that ensures idempotency. This token expires in 10 minutes. Length Constraints: Minimum length of 1. Maximum length of 64. Pattern: ^[a-zA-Z0-9-]+$ Required: Yes databaseName The name |
api-reference-018 | api-reference.pdf | 18 | SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 DeleteKxClusterNode 89 Amazon FinSpace DeleteKxDatabase Management API Reference Deletes the specified database and all of its associated data. This action is irreversible. You must copy any data out of the database before deleting it if the data is to be retained. Request Syntax DELETE /kx/environments/environmentId/databases/databaseName?clientToken=clientToken HTTP/1.1 URI Request Parameters The request uses the following URI parameters. clientToken A token that ensures idempotency. This token expires in 10 minutes. Length Constraints: Minimum length of 1. Maximum length of 64. Pattern: ^[a-zA-Z0-9-]+$ Required: Yes databaseName The name of the kdb database that you want to delete. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: .*\S.* Required: Yes DeleteKxDatabase 90 Management API Reference Amazon FinSpace Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Response Elements If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 DeleteKxDatabase 91 Amazon FinSpace ValidationException Management API Reference The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 DeleteKxDatabase 92 Amazon FinSpace DeleteKxDataview Management API Reference Deletes the specified dataview. Before deleting a dataview, make sure that it is not in use by any cluster. Request Syntax DELETE /kx/environments/environmentId/databases/databaseName/dataviews/dataviewName? clientToken=clientToken HTTP/1.1 URI Request Parameters The request uses the following URI parameters. clientToken A token that ensures idempotency. This token expires in 10 minutes. Length Constraints: Minimum length of 1. Maximum length of 64. Pattern: ^[a-zA-Z0-9-]+$ Required: Yes databaseName The name of the database whose dataview you want to delete. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes dataviewName The name of the dataview that you want to delete. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes DeleteKxDataview 93 Amazon FinSpace environmentId Management API Reference A unique identifier for the kdb environment, from where you want to delete the dataview. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: .*\S.* Required: Yes Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Response Elements If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 DeleteKxDataview 94 Management API Reference Amazon FinSpace ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 DeleteKxDataview 95 Amazon FinSpace Management API Reference DeleteKxEnvironment Deletes the kdb environment. This action is irreversible. Deleting a kdb environment will remove all the associated data and any services running in it. Request Syntax DELETE /kx/environments/environmentId?clientToken=clientToken HTTP/1.1 URI Request Parameters The request uses the following |
api-reference-019 | api-reference.pdf | 19 | • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 DeleteKxDataview 95 Amazon FinSpace Management API Reference DeleteKxEnvironment Deletes the kdb environment. This action is irreversible. Deleting a kdb environment will remove all the associated data and any services running in it. Request Syntax DELETE /kx/environments/environmentId?clientToken=clientToken HTTP/1.1 URI Request Parameters The request uses the following URI parameters. clientToken A token that ensures idempotency. This token expires in 10 minutes. Length Constraints: Minimum length of 1. Maximum length of 36. Pattern: .*\S.* environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: Yes Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Response Elements If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. DeleteKxEnvironment 96 Amazon FinSpace Errors Management API Reference For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface DeleteKxEnvironment 97 Management API Reference Amazon FinSpace • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 DeleteKxEnvironment 98 Amazon FinSpace Management API Reference DeleteKxScalingGroup Deletes the specified scaling group. This action is irreversible. You cannot delete a scaling group until all the clusters running on it have been deleted. Request Syntax DELETE /kx/environments/environmentId/scalingGroups/scalingGroupName? clientToken=clientToken HTTP/1.1 URI Request Parameters The request uses the following URI parameters. clientToken A token that ensures idempotency. This token expires in 10 minutes. Length Constraints: Minimum length of 1. Maximum length of 64. Pattern: ^[a-zA-Z0-9-]+$ environmentId A unique identifier for the kdb environment, from where you want to delete the dataview. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ Required: Yes scalingGroupName A unique identifier for the kdb scaling group. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes DeleteKxScalingGroup 99 Management API Reference Amazon FinSpace Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Response Elements If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 LimitExceededException A service limit or quota is exceeded. HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 DeleteKxScalingGroup 100 Management API Reference Amazon FinSpace ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 DeleteKxScalingGroup 101 Amazon FinSpace DeleteKxUser Deletes a user in the specified kdb environment. Request Syntax Management API Reference DELETE /kx/environments/environmentId/users/userName?clientToken=clientToken HTTP/1.1 URI Request Parameters The request uses the following URI parameters. clientToken A token that ensures idempotency. This token expires in 10 minutes. Length Constraints: Minimum length of 1. Maximum length of 36. Pattern: |
api-reference-020 | api-reference.pdf | 20 | .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 DeleteKxScalingGroup 101 Amazon FinSpace DeleteKxUser Deletes a user in the specified kdb environment. Request Syntax Management API Reference DELETE /kx/environments/environmentId/users/userName?clientToken=clientToken HTTP/1.1 URI Request Parameters The request uses the following URI parameters. clientToken A token that ensures idempotency. This token expires in 10 minutes. Length Constraints: Minimum length of 1. Maximum length of 36. Pattern: .*\S.* environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: Yes userName A unique identifier for the user that you want to delete. Length Constraints: Minimum length of 1. Maximum length of 50. Pattern: ^[0-9A-Za-z_-]{1,50}$ Required: Yes Request Body The request does not have a request body. DeleteKxUser 102 Amazon FinSpace Response Syntax HTTP/1.1 200 Response Elements Management API Reference If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. DeleteKxUser 103 Amazon FinSpace HTTP Status Code: 400 See Also Management API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 DeleteKxUser 104 Amazon FinSpace DeleteKxVolume Management API Reference Deletes a volume. You can only delete a volume if it's not attached to a cluster or a dataview. When a volume is deleted, any data on the volume is lost. This action is irreversible. Request Syntax DELETE /kx/environments/environmentId/kxvolumes/volumeName?clientToken=clientToken HTTP/1.1 URI Request Parameters The request uses the following URI parameters. clientToken A token that ensures idempotency. This token expires in 10 minutes. Length Constraints: Minimum length of 1. Maximum length of 64. Pattern: ^[a-zA-Z0-9-]+$ environmentId A unique identifier for the kdb environment, whose clusters can attach to the volume. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ Required: Yes volumeName The name of the volume that you want to delete. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes DeleteKxVolume 105 Management API Reference Amazon FinSpace Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Response Elements If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 LimitExceededException A service limit or quota is exceeded. HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 DeleteKxVolume 106 Management API Reference Amazon FinSpace ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 DeleteKxVolume 107 Management API Reference Amazon FinSpace GetEnvironment Returns the FinSpace environment object. Request Syntax GET /environment/environmentId HTTP/1.1 URI Request Parameters The request uses the following URI parameters. environmentId The identifier of the FinSpace environment. Length Constraints: Minimum length of 1. Maximum length |
api-reference-021 | api-reference.pdf | 21 | the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 DeleteKxVolume 107 Management API Reference Amazon FinSpace GetEnvironment Returns the FinSpace environment object. Request Syntax GET /environment/environmentId HTTP/1.1 URI Request Parameters The request uses the following URI parameters. environmentId The identifier of the FinSpace environment. Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: Yes Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Content-type: application/json { "environment": { "awsAccountId": "string", "dedicatedServiceAccountId": "string", "description": "string", "environmentArn": "string", "environmentId": "string", "environmentUrl": "string", "federationMode": "string", "federationParameters": { GetEnvironment 108 Amazon FinSpace Management API Reference "applicationCallBackURL": "string", "attributeMap": { "string" : "string" }, "federationProviderName": "string", "federationURN": "string", "samlMetadataDocument": "string", "samlMetadataURL": "string" }, "kmsKeyId": "string", "name": "string", "sageMakerStudioDomainUrl": "string", "status": "string" } } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. environment The name of the FinSpace environment. Type: Environment object Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 GetEnvironment 109 Amazon FinSpace ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ValidationException Management API Reference The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 GetEnvironment 110 Amazon FinSpace GetKxChangeset Returns information about a kdb changeset. Request Syntax Management API Reference GET /kx/environments/environmentId/databases/databaseName/changesets/changesetId HTTP/1.1 URI Request Parameters The request uses the following URI parameters. changesetId A unique identifier of the changeset for which you want to retrieve data. Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]+$ Required: Yes databaseName The name of the kdb database. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: .*\S.* Required: Yes GetKxChangeset 111 Management API Reference Amazon FinSpace Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Content-type: application/json { "activeFromTimestamp": number, "changeRequests": [ { "changeType": "string", "dbPath": "string", "s3Path": "string" } ], "changesetId": "string", "createdTimestamp": number, "databaseName": "string", "environmentId": "string", "errorInfo": { "errorMessage": "string", "errorType": "string" }, "lastModifiedTimestamp": number, "status": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. activeFromTimestamp Beginning time from which the changeset is active. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp GetKxChangeset 112 Amazon FinSpace changeRequests Management API Reference A list of change request objects that are run in order. Type: Array of ChangeRequest objects Array Members: Minimum number of 1 item. Maximum number of 32 items. changesetId A unique identifier for the changeset. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]+$ createdTimestamp The timestamp at which the changeset was created in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp databaseName The name of the kdb database. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ environmentId A unique identifier for the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: .*\S.* GetKxChangeset 113 Amazon FinSpace errorInfo Management API Reference Provides details in the event of a failed flow, including the error type and the related error message. Type: ErrorInfo object lastModifiedTimestamp The timestamp at which the changeset was updated in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp status Status of the changeset creation process. |
api-reference-022 | api-reference.pdf | 22 | of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ environmentId A unique identifier for the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: .*\S.* GetKxChangeset 113 Amazon FinSpace errorInfo Management API Reference Provides details in the event of a failed flow, including the error type and the related error message. Type: ErrorInfo object lastModifiedTimestamp The timestamp at which the changeset was updated in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp status Status of the changeset creation process. • Pending – Changeset creation is pending. • Processing – Changeset creation is running. • Failed – Changeset creation has failed. • Complete – Changeset creation has succeeded. Type: String Valid Values: PENDING | PROCESSING | FAILED | COMPLETED Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 GetKxChangeset 114 Management API Reference Amazon FinSpace ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 GetKxChangeset 115 Management API Reference Amazon FinSpace GetKxCluster Retrieves information about a kdb cluster. Request Syntax GET /kx/environments/environmentId/clusters/clusterName HTTP/1.1 URI Request Parameters The request uses the following URI parameters. clusterName The name of the cluster that you want to retrieve. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ Required: Yes Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Content-type: application/json { "autoScalingConfiguration": { "autoScalingMetric": "string", GetKxCluster 116 Amazon FinSpace Management API Reference "maxNodeCount": number, "metricTarget": number, "minNodeCount": number, "scaleInCooldownSeconds": number, "scaleOutCooldownSeconds": number }, "availabilityZoneId": "string", "azMode": "string", "cacheStorageConfigurations": [ { "size": number, "type": "string" } ], "capacityConfiguration": { "nodeCount": number, "nodeType": "string" }, "clusterDescription": "string", "clusterName": "string", "clusterType": "string", "code": { "s3Bucket": "string", "s3Key": "string", "s3ObjectVersion": "string" }, "commandLineArguments": [ { "key": "string", "value": "string" } ], "createdTimestamp": number, "databases": [ { "cacheConfigurations": [ { "cacheType": "string", "dataviewName": "string", "dbPaths": [ "string" ] } ], "changesetId": "string", "databaseName": "string", GetKxCluster 117 Amazon FinSpace Management API Reference "dataviewConfiguration": { "changesetId": "string", "dataviewName": "string", "dataviewVersionId": "string", "segmentConfigurations": [ { "dbPaths": [ "string" ], "onDemand": boolean, "volumeName": "string" } ] }, "dataviewName": "string" } ], "executionRole": "string", "initializationScript": "string", "lastModifiedTimestamp": number, "releaseLabel": "string", "savedownStorageConfiguration": { "size": number, "type": "string", "volumeName": "string" }, "scalingGroupConfiguration": { "cpu": number, "memoryLimit": number, "memoryReservation": number, "nodeCount": number, "scalingGroupName": "string" }, "status": "string", "statusReason": "string", "tickerplantLogConfiguration": { "tickerplantLogVolumes": [ "string" ] }, "volumes": [ { "volumeName": "string", "volumeType": "string" } ], "vpcConfiguration": { "ipAddressType": "string", GetKxCluster 118 Amazon FinSpace Management API Reference "securityGroupIds": [ "string" ], "subnetIds": [ "string" ], "vpcId": "string" } } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. autoScalingConfiguration The configuration based on which FinSpace will scale in or scale out nodes in your cluster. Type: AutoScalingConfiguration object availabilityZoneId The availability zone identifiers for the requested regions. Type: String Length Constraints: Minimum length of 8. Maximum length of 12. Pattern: ^[a-zA-Z0-9-]+$ azMode The number of availability zones you want to assign per cluster. This can be one of the following • SINGLE – Assigns one availability zone per cluster. • MULTI – Assigns all the availability zones per cluster. Type: String Valid Values: SINGLE | MULTI cacheStorageConfigurations The configurations for a read only cache storage associated with a cluster. This cache will be stored as an FSx Lustre that reads from the S3 store. Type: Array of KxCacheStorageConfiguration objects GetKxCluster 119 Amazon FinSpace capacityConfiguration Management API Reference A structure for the metadata of a cluster. It includes information like the CPUs needed, memory of instances, and number of instances. Type: CapacityConfiguration object clusterDescription A description of the cluster. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9\_\-\.\s]+$ clusterName A unique |
api-reference-023 | api-reference.pdf | 23 | availability zones per cluster. Type: String Valid Values: SINGLE | MULTI cacheStorageConfigurations The configurations for a read only cache storage associated with a cluster. This cache will be stored as an FSx Lustre that reads from the S3 store. Type: Array of KxCacheStorageConfiguration objects GetKxCluster 119 Amazon FinSpace capacityConfiguration Management API Reference A structure for the metadata of a cluster. It includes information like the CPUs needed, memory of instances, and number of instances. Type: CapacityConfiguration object clusterDescription A description of the cluster. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9\_\-\.\s]+$ clusterName A unique name for the cluster. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ clusterType Specifies the type of KDB database that is being created. The following types are available: • HDB – A Historical Database. The data is only accessible with read-only permissions from one of the FinSpace managed kdb databases mounted to the cluster. • RDB – A Realtime Database. This type of database captures all the data from a ticker plant and stores it in memory until the end of day, after which it writes all of its data to a disk and reloads the HDB. This cluster type requires local storage for temporary storage of data during the savedown process. If you specify this field in your request, you must provide the savedownStorageConfiguration parameter. • GATEWAY – A gateway cluster allows you to access data across processes in kdb systems. It allows you to create your own routing logic using the initialization scripts and custom code. This type of cluster does not require a writable local storage. • GP – A general purpose cluster allows you to quickly iterate on code during development by granting greater access to system commands and enabling a fast reload of custom code. This GetKxCluster 120 Amazon FinSpace Management API Reference cluster type can optionally mount databases including cache and savedown storage. For this cluster type, the node count is fixed at 1. It does not support autoscaling and supports only SINGLE AZ mode. • Tickerplant – A tickerplant cluster allows you to subscribe to feed handlers based on IAM permissions. It can publish to RDBs, other Tickerplants, and real-time subscribers (RTS). Tickerplants can persist messages to log, which is readable by any RDB environment. It supports only single-node that is only one kdb process. Type: String Valid Values: HDB | RDB | GATEWAY | GP | TICKERPLANT code The details of the custom code that you want to use inside a cluster when analyzing a data. It consists of the S3 source bucket, location, S3 object version, and the relative path from where the custom code is loaded into the cluster. Type: CodeConfiguration object commandLineArguments Defines key-value pairs to make them available inside the cluster. Type: Array of KxCommandLineArgument objects createdTimestamp The timestamp at which the cluster was created in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp databases A list of databases mounted on the cluster. Type: Array of KxDatabaseConfiguration objects executionRole An IAM role that defines a set of permissions associated with a cluster. These permissions are assumed when a cluster attempts to access another cluster. GetKxCluster 121 Amazon FinSpace Type: String Management API Reference Length Constraints: Minimum length of 1. Maximum length of 1024. Pattern: ^arn:aws[a-z0-9-]*:iam::\d{12}:role\/[\w-\/.@+=,]{1,1017}$ initializationScript Specifies a Q program that will be run at launch of a cluster. It is a relative path within .zip file that contains the custom code, which will be loaded on the cluster. It must include the file name itself. For example, somedir/init.q. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: ^[a-zA-Z0-9\_\-\.\/\\]+$ lastModifiedTimestamp The last time that the cluster was modified. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp releaseLabel The version of FinSpace managed kdb to run. Type: String Length Constraints: Minimum length of 1. Maximum length of 16. Pattern: ^[a-zA-Z0-9._-]+$ savedownStorageConfiguration The size and type of the temporary storage that is used to hold data during the savedown process. This parameter is required when you choose clusterType as RDB. All the data written to this storage space is lost when the cluster node is restarted. Type: KxSavedownStorageConfiguration object scalingGroupConfiguration The structure that stores the capacity configuration details of a scaling group. GetKxCluster 122 Amazon FinSpace Management API Reference Type: KxScalingGroupConfiguration object status The status of cluster creation. • PENDING – The cluster is pending creation. • CREATING – The cluster creation process is in progress. • CREATE_FAILED – The cluster creation process has failed. • RUNNING – The cluster creation |
api-reference-024 | api-reference.pdf | 24 | is used to hold data during the savedown process. This parameter is required when you choose clusterType as RDB. All the data written to this storage space is lost when the cluster node is restarted. Type: KxSavedownStorageConfiguration object scalingGroupConfiguration The structure that stores the capacity configuration details of a scaling group. GetKxCluster 122 Amazon FinSpace Management API Reference Type: KxScalingGroupConfiguration object status The status of cluster creation. • PENDING – The cluster is pending creation. • CREATING – The cluster creation process is in progress. • CREATE_FAILED – The cluster creation process has failed. • RUNNING – The cluster creation process is running. • UPDATING – The cluster is in the process of being updated. • DELETING – The cluster is in the process of being deleted. • DELETED – The cluster has been deleted. • DELETE_FAILED – The cluster failed to delete. Type: String Valid Values: PENDING | CREATING | CREATE_FAILED | RUNNING | UPDATING | DELETING | DELETED | DELETE_FAILED statusReason The error message when a failed state occurs. Type: String Length Constraints: Minimum length of 1. Maximum length of 250. Pattern: ^[a-zA-Z0-9\_\-\.\s]+$ tickerplantLogConfiguration A configuration to store the Tickerplant logs. It consists of a list of volumes that will be mounted to your cluster. For the cluster type Tickerplant, the location of the TP volume on the cluster will be available by using the global variable .aws.tp_log_path. Type: TickerplantLogConfiguration object volumes A list of volumes attached to the cluster. Type: Array of Volume objects GetKxCluster 123 Amazon FinSpace Management API Reference Array Members: Minimum number of 0 items. Maximum number of 5 items. vpcConfiguration Configuration details about the network where the Privatelink endpoint of the cluster resides. Type: VpcConfiguration object Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 LimitExceededException A service limit or quota is exceeded. HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 GetKxCluster 124 Amazon FinSpace ValidationException Management API Reference The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 GetKxCluster 125 Amazon FinSpace Management API Reference GetKxConnectionString Retrieves a connection string for a user to connect to a kdb cluster. You must call this API using the same role that you have defined while creating a user. Request Syntax GET /kx/environments/environmentId/connectionString? clusterName=clusterName&userArn=userArn HTTP/1.1 URI Request Parameters The request uses the following URI parameters. clusterName A name of the kdb cluster. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: Yes userArn The Amazon Resource Name (ARN) that identifies the user. For more information about ARNs and how to use ARNs in policies, see IAM Identifiers in the IAM User Guide. Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\d+:kxEnvironment/[0-9A- Za-z_-]{1,128}/kxUser/[0-9A-Za-z_-]{1,128}$ GetKxConnectionString 126 Management API Reference Amazon FinSpace Required: Yes Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Content-type: application/json { "signedConnectionString": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. signedConnectionString The signed connection string that you can use to connect to clusters. Type: String Length Constraints: Minimum length of 1. Maximum length of 2048. Pattern: ^(:|:tcps:\/\/)[a-zA-Z0-9-\.\_]+:\d+:[a-zA-Z0-9-\.\_]+:\S+$ Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 GetKxConnectionString 127 Amazon FinSpace InternalServerException Management API Reference The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP |
api-reference-025 | api-reference.pdf | 25 | Maximum length of 2048. Pattern: ^(:|:tcps:\/\/)[a-zA-Z0-9-\.\_]+:\d+:[a-zA-Z0-9-\.\_]+:\S+$ Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 GetKxConnectionString 127 Amazon FinSpace InternalServerException Management API Reference The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 GetKxConnectionString 128 Amazon FinSpace GetKxDatabase Management API Reference Returns database information for the specified environment ID. Request Syntax GET /kx/environments/environmentId/databases/databaseName HTTP/1.1 URI Request Parameters The request uses the following URI parameters. databaseName The name of the kdb database. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: .*\S.* Required: Yes Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Content-type: application/json { GetKxDatabase 129 Amazon FinSpace Management API Reference "createdTimestamp": number, "databaseArn": "string", "databaseName": "string", "description": "string", "environmentId": "string", "lastCompletedChangesetId": "string", "lastModifiedTimestamp": number, "numBytes": number, "numChangesets": number, "numFiles": number } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. createdTimestamp The timestamp at which the database is created in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp databaseArn The ARN identifier of the database. Type: String databaseName The name of the kdb database for which the information is retrieved. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ description A description of the database. GetKxDatabase 130 Amazon FinSpace Type: String Management API Reference Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ environmentId A unique identifier for the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: .*\S.* lastCompletedChangesetId A unique identifier for the changeset. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]+$ lastModifiedTimestamp The last time that the database was modified. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp numBytes The total number of bytes in the database. Type: Long numChangesets The total number of changesets in the database. Type: Integer GetKxDatabase 131 Amazon FinSpace numFiles The total number of files in the database. Type: Integer Errors Management API Reference For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: GetKxDatabase 132 Amazon FinSpace Management API Reference • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 GetKxDatabase 133 Amazon FinSpace GetKxDataview Retrieves details of the dataview. Request Syntax Management API Reference GET /kx/environments/environmentId/databases/databaseName/dataviews/dataviewName HTTP/1.1 URI Request Parameters The request uses the following URI parameters. databaseName The name of the database where you created the dataview. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes dataviewName A unique identifier for the dataview. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes environmentId A unique identifier for the kdb environment, from where you want |
api-reference-026 | api-reference.pdf | 26 | for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 GetKxDatabase 133 Amazon FinSpace GetKxDataview Retrieves details of the dataview. Request Syntax Management API Reference GET /kx/environments/environmentId/databases/databaseName/dataviews/dataviewName HTTP/1.1 URI Request Parameters The request uses the following URI parameters. databaseName The name of the database where you created the dataview. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes dataviewName A unique identifier for the dataview. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes environmentId A unique identifier for the kdb environment, from where you want to retrieve the dataview details. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: .*\S.* GetKxDataview 134 Management API Reference Amazon FinSpace Required: Yes Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Content-type: application/json { "activeVersions": [ { "attachedClusters": [ "string" ], "changesetId": "string", "createdTimestamp": number, "segmentConfigurations": [ { "dbPaths": [ "string" ], "onDemand": boolean, "volumeName": "string" } ], "versionId": "string" } ], "autoUpdate": boolean, "availabilityZoneId": "string", "azMode": "string", "changesetId": "string", "createdTimestamp": number, "databaseName": "string", "dataviewName": "string", "description": "string", "environmentId": "string", "lastModifiedTimestamp": number, "readWrite": boolean, "segmentConfigurations": [ { "dbPaths": [ "string" ], "onDemand": boolean, "volumeName": "string" GetKxDataview 135 Amazon FinSpace } ], "status": "string", "statusReason": "string" } Response Elements Management API Reference If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. activeVersions The current active changeset versions of the database on the given dataview. Type: Array of KxDataviewActiveVersion objects autoUpdate The option to specify whether you want to apply all the future additions and corrections automatically to the dataview when new changesets are ingested. The default value is false. Type: Boolean availabilityZoneId The identifier of the availability zones. Type: String Length Constraints: Minimum length of 8. Maximum length of 12. Pattern: ^[a-zA-Z0-9-]+$ azMode The number of availability zones you want to assign per volume. Currently, FinSpace only supports SINGLE for volumes. This places dataview in a single AZ. Type: String Valid Values: SINGLE | MULTI GetKxDataview 136 Amazon FinSpace changesetId Management API Reference A unique identifier of the changeset that you want to use to ingest data. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]+$ createdTimestamp The timestamp at which the dataview was created in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp databaseName The name of the database where you created the dataview. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ dataviewName A unique identifier for the dataview. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ description A description of the dataview. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. GetKxDataview 137 Amazon FinSpace Management API Reference Pattern: ^[a-zA-Z0-9. ]{1,1000}$ environmentId A unique identifier for the kdb environment, from where you want to retrieve the dataview details. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: .*\S.* lastModifiedTimestamp The last time that the dataview was updated in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp readWrite Returns True if the dataview is created as writeable and False otherwise. Type: Boolean segmentConfigurations The configuration that contains the database path of the data that you want to place on each selected volume. Each segment must have a unique database path for each volume. If you do not explicitly specify any database path for a volume, they are accessible from the cluster through the default S3/object store segment. Type: Array of KxDataviewSegmentConfiguration objects Array Members: Minimum number of 0 items. Maximum number of 50 items. status The status of dataview creation. • CREATING – The dataview creation is in progress. • UPDATING – The dataview is in the process of being updated. • ACTIVE – The dataview is active. GetKxDataview 138 Amazon FinSpace Type: String Management API Reference Valid Values: CREATING | ACTIVE | UPDATING | FAILED | DELETING statusReason The error message when a failed state occurs. Type: String Length Constraints: Minimum length of 1. Maximum length of 250. Pattern: ^[a-zA-Z0-9\_\-\.\s]+$ Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status |
api-reference-027 | api-reference.pdf | 27 | | UPDATING | FAILED | DELETING statusReason The error message when a failed state occurs. Type: String Length Constraints: Minimum length of 1. Maximum length of 250. Pattern: ^[a-zA-Z0-9\_\-\.\s]+$ Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. GetKxDataview 139 Amazon FinSpace HTTP Status Code: 400 See Also Management API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 GetKxDataview 140 Amazon FinSpace GetKxEnvironment Retrieves all the information for the specified kdb environment. Management API Reference Request Syntax GET /kx/environments/environmentId HTTP/1.1 URI Request Parameters The request uses the following URI parameters. environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: Yes Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Content-type: application/json { "availabilityZoneIds": [ "string" ], "awsAccountId": "string", "certificateAuthorityArn": "string", "creationTimestamp": number, "customDNSConfiguration": [ { "customDNSServerIP": "string", "customDNSServerName": "string" } ], GetKxEnvironment 141 Amazon FinSpace Management API Reference "dedicatedServiceAccountId": "string", "description": "string", "dnsStatus": "string", "environmentArn": "string", "environmentId": "string", "errorMessage": "string", "kmsKeyId": "string", "name": "string", "status": "string", "tgwStatus": "string", "transitGatewayConfiguration": { "attachmentNetworkAclConfiguration": [ { "cidrBlock": "string", "icmpTypeCode": { "code": number, "type": number }, "portRange": { "from": number, "to": number }, "protocol": "string", "ruleAction": "string", "ruleNumber": number } ], "routableCIDRSpace": "string", "transitGatewayID": "string" }, "updateTimestamp": number } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. availabilityZoneIds The identifier of the availability zones where subnets for the environment are created. Type: Array of strings GetKxEnvironment 142 Amazon FinSpace Management API Reference Length Constraints: Minimum length of 8. Maximum length of 12. Pattern: ^[a-zA-Z0-9-]+$ awsAccountId The unique identifier of the AWS account that is used to create the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ certificateAuthorityArn The Amazon Resource Name (ARN) of the certificate authority of the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. creationTimestamp The timestamp at which the kdb environment was created in FinSpace. Type: Timestamp customDNSConfiguration A list of DNS server name and server IP. This is used to set up Route-53 outbound resolvers. Type: Array of CustomDNSServer objects dedicatedServiceAccountId A unique identifier for the AWS environment infrastructure account. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ description A description for the kdb environment. GetKxEnvironment 143 Amazon FinSpace Type: String Management API Reference Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ dnsStatus The status of DNS configuration. Type: String Valid Values: NONE | UPDATE_REQUESTED | UPDATING | FAILED_UPDATE | SUCCESSFULLY_UPDATED environmentArn The ARN identifier of the environment. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\d+:environment/[0-9A-Za- z_-]{1,128}$ environmentId A unique identifier for the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ errorMessage Specifies the error message that appears if a flow fails. Type: String Length Constraints: Minimum length of 0. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ GetKxEnvironment 144 Amazon FinSpace kmsKeyId Management API Reference The KMS key ID to encrypt your data in the FinSpace environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z-0-9-:\/]*$ name The name of the kdb environment. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ status The status of the kdb environment. Type: String Valid Values: CREATE_REQUESTED | CREATING | CREATED | DELETE_REQUESTED | DELETING | DELETED | FAILED_CREATION | RETRY_DELETION | FAILED_DELETION | UPDATE_NETWORK_REQUESTED | UPDATING_NETWORK | FAILED_UPDATING_NETWORK | SUSPENDED tgwStatus The status of the network configuration. Type: String Valid Values: NONE | UPDATE_REQUESTED | UPDATING | FAILED_UPDATE | SUCCESSFULLY_UPDATED transitGatewayConfiguration The structure of the transit gateway and network configuration that is used to connect the kdb environment to an internal network. Type: TransitGatewayConfiguration object GetKxEnvironment 145 Amazon FinSpace updateTimestamp Management API Reference The timestamp at |
api-reference-028 | api-reference.pdf | 28 | of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ status The status of the kdb environment. Type: String Valid Values: CREATE_REQUESTED | CREATING | CREATED | DELETE_REQUESTED | DELETING | DELETED | FAILED_CREATION | RETRY_DELETION | FAILED_DELETION | UPDATE_NETWORK_REQUESTED | UPDATING_NETWORK | FAILED_UPDATING_NETWORK | SUSPENDED tgwStatus The status of the network configuration. Type: String Valid Values: NONE | UPDATE_REQUESTED | UPDATING | FAILED_UPDATE | SUCCESSFULLY_UPDATED transitGatewayConfiguration The structure of the transit gateway and network configuration that is used to connect the kdb environment to an internal network. Type: TransitGatewayConfiguration object GetKxEnvironment 145 Amazon FinSpace updateTimestamp Management API Reference The timestamp at which the kdb environment was updated. Type: Timestamp Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: GetKxEnvironment 146 Amazon FinSpace Management API Reference • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 GetKxEnvironment 147 Amazon FinSpace GetKxScalingGroup Retrieves details of a scaling group. Request Syntax Management API Reference GET /kx/environments/environmentId/scalingGroups/scalingGroupName HTTP/1.1 URI Request Parameters The request uses the following URI parameters. environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ Required: Yes scalingGroupName A unique identifier for the kdb scaling group. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Content-type: application/json { GetKxScalingGroup 148 Amazon FinSpace Management API Reference "availabilityZoneId": "string", "clusters": [ "string" ], "createdTimestamp": number, "hostType": "string", "lastModifiedTimestamp": number, "scalingGroupArn": "string", "scalingGroupName": "string", "status": "string", "statusReason": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. availabilityZoneId The identifier of the availability zones. Type: String Length Constraints: Minimum length of 8. Maximum length of 12. Pattern: ^[a-zA-Z0-9-]+$ clusters The list of Managed kdb clusters that are currently active in the given scaling group. Type: Array of strings Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ createdTimestamp The timestamp at which the scaling group was created in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp GetKxScalingGroup 149 Amazon FinSpace hostType Management API Reference The memory and CPU capabilities of the scaling group host on which FinSpace Managed kdb clusters will be placed. It can have one of the following values: • kx.sg.large – The host type with a configuration of 16 GiB memory and 2 vCPUs. • kx.sg.xlarge – The host type with a configuration of 32 GiB memory and 4 vCPUs. • kx.sg.2xlarge – The host type with a configuration of 64 GiB memory and 8 vCPUs. • kx.sg.4xlarge – The host type with a configuration of 108 GiB memory and 16 vCPUs. • kx.sg.8xlarge – The host type with a configuration of 216 GiB memory and 32 vCPUs. • kx.sg.16xlarge – The host type with a configuration of 432 GiB memory and 64 vCPUs. • kx.sg.32xlarge – The host type with a configuration of 864 GiB memory and 128 vCPUs. • kx.sg1.16xlarge – The host type with a configuration of 1949 GiB memory and 64 vCPUs. • kx.sg1.24xlarge – The host type with a configuration of 2948 GiB memory and 96 vCPUs. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-zA-Z0-9._]+ lastModifiedTimestamp The last time that the scaling group was updated in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp scalingGroupArn The ARN identifier for the scaling group. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:*:*:*:*:* GetKxScalingGroup 150 Management API Reference Amazon FinSpace scalingGroupName A unique identifier for the kdb scaling group. Type: String Length Constraints: Minimum length of 3. Maximum |
api-reference-029 | api-reference.pdf | 29 | Type: String Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-zA-Z0-9._]+ lastModifiedTimestamp The last time that the scaling group was updated in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp scalingGroupArn The ARN identifier for the scaling group. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:*:*:*:*:* GetKxScalingGroup 150 Management API Reference Amazon FinSpace scalingGroupName A unique identifier for the kdb scaling group. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ status The status of scaling group. • CREATING – The scaling group creation is in progress. • CREATE_FAILED – The scaling group creation has failed. • ACTIVE – The scaling group is active. • UPDATING – The scaling group is in the process of being updated. • UPDATE_FAILED – The update action failed. • DELETING – The scaling group is in the process of being deleted. • DELETE_FAILED – The system failed to delete the scaling group. • DELETED – The scaling group is successfully deleted. Type: String Valid Values: CREATING | CREATE_FAILED | ACTIVE | DELETING | DELETED | DELETE_FAILED statusReason The error message when a failed state occurs. Type: String Length Constraints: Minimum length of 1. Maximum length of 250. Pattern: ^[a-zA-Z0-9\_\-\.\s]+$ Errors For information about the errors that are common to all actions, see Common Errors. GetKxScalingGroup 151 Amazon FinSpace AccessDeniedException Management API Reference You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 LimitExceededException A service limit or quota is exceeded. HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: GetKxScalingGroup 152 Amazon FinSpace Management API Reference • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 GetKxScalingGroup 153 Management API Reference Amazon FinSpace GetKxUser Retrieves information about the specified kdb user. Request Syntax GET /kx/environments/environmentId/users/userName HTTP/1.1 URI Request Parameters The request uses the following URI parameters. environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: Yes userName A unique identifier for the user. Length Constraints: Minimum length of 1. Maximum length of 50. Pattern: ^[0-9A-Za-z_-]{1,50}$ Required: Yes Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Content-type: application/json { "environmentId": "string", GetKxUser 154 Amazon FinSpace Management API Reference "iamRole": "string", "userArn": "string", "userName": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. environmentId A unique identifier for the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ iamRole The IAM role ARN that is associated with the user. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws[a-z\-]*:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+$ userArn The Amazon Resource Name (ARN) that identifies the user. For more information about ARNs and how to use ARNs in policies, see IAM Identifiers in the IAM User Guide. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\d+:kxEnvironment/[0-9A- Za-z_-]{1,128}/kxUser/[0-9A-Za-z_-]{1,128}$ userName A unique identifier for the user. GetKxUser 155 Amazon FinSpace Type: String Management API Reference Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: GetKxUser 156 |
api-reference-030 | api-reference.pdf | 30 | actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: GetKxUser 156 Amazon FinSpace Management API Reference • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 GetKxUser 157 Amazon FinSpace GetKxVolume Retrieves the information about the volume. Request Syntax Management API Reference GET /kx/environments/environmentId/kxvolumes/volumeName HTTP/1.1 URI Request Parameters The request uses the following URI parameters. environmentId A unique identifier for the kdb environment, whose clusters can attach to the volume. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ Required: Yes volumeName A unique identifier for the volume. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Content-type: application/json GetKxVolume 158 Management API Reference Amazon FinSpace { "attachedClusters": [ { "clusterName": "string", "clusterStatus": "string", "clusterType": "string" } ], "availabilityZoneIds": [ "string" ], "azMode": "string", "createdTimestamp": number, "description": "string", "environmentId": "string", "lastModifiedTimestamp": number, "nas1Configuration": { "size": number, "type": "string" }, "status": "string", "statusReason": "string", "volumeArn": "string", "volumeName": "string", "volumeType": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. attachedClusters A list of cluster identifiers that a volume is attached to. Type: Array of KxAttachedCluster objects availabilityZoneIds The identifier of the availability zones. Type: Array of strings Length Constraints: Minimum length of 8. Maximum length of 12. GetKxVolume 159 Amazon FinSpace Management API Reference Pattern: ^[a-zA-Z0-9-]+$ azMode The number of availability zones you want to assign per volume. Currently, FinSpace only supports SINGLE for volumes. This places dataview in a single AZ. Type: String Valid Values: SINGLE | MULTI createdTimestamp The timestamp at which the volume was created in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp description A description of the volume. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ environmentId A unique identifier for the kdb environment, whose clusters can attach to the volume. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ lastModifiedTimestamp The last time that the volume was updated in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp GetKxVolume 160 Amazon FinSpace nas1Configuration Management API Reference Specifies the configuration for the Network attached storage (NAS_1) file system volume. Type: KxNAS1Configuration object status The status of volume creation. • CREATING – The volume creation is in progress. • CREATE_FAILED – The volume creation has failed. • ACTIVE – The volume is active. • UPDATING – The volume is in the process of being updated. • UPDATE_FAILED – The update action failed. • UPDATED – The volume is successfully updated. • DELETING – The volume is in the process of being deleted. • DELETE_FAILED – The system failed to delete the volume. • DELETED – The volume is successfully deleted. Type: String Valid Values: CREATING | CREATE_FAILED | ACTIVE | UPDATING | UPDATED | UPDATE_FAILED | DELETING | DELETED | DELETE_FAILED statusReason The error message when a failed state occurs. Type: String Length Constraints: Minimum length of 1. Maximum length of 250. Pattern: ^[a-zA-Z0-9\_\-\.\s]+$ volumeArn The ARN identifier of the volume. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. GetKxVolume 161 Amazon FinSpace Management API Reference Pattern: ^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\d+:kxEnvironment/[0-9A- Za-z_-]{1,128}(/kxSharedVolume/[a-zA-Z0-9_-]{1,255})?$ volumeName A unique identifier for the volume. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ volumeType The type of file system volume. Currently, FinSpace only supports NAS_1 volume type. Type: String Valid Values: NAS_1 Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and |
api-reference-031 | api-reference.pdf | 31 | String Length Constraints: Minimum length of 20. Maximum length of 2048. GetKxVolume 161 Amazon FinSpace Management API Reference Pattern: ^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\d+:kxEnvironment/[0-9A- Za-z_-]{1,128}(/kxSharedVolume/[a-zA-Z0-9_-]{1,255})?$ volumeName A unique identifier for the volume. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ volumeType The type of file system volume. Currently, FinSpace only supports NAS_1 volume type. Type: String Valid Values: NAS_1 Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 LimitExceededException A service limit or quota is exceeded. GetKxVolume 162 Management API Reference Amazon FinSpace HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 GetKxVolume 163 Management API Reference Amazon FinSpace ListEnvironments A list of all of your FinSpace environments. Request Syntax GET /environment?maxResults=maxResults&nextToken=nextToken HTTP/1.1 URI Request Parameters The request uses the following URI parameters. maxResults The maximum number of results to return in this request. Valid Range: Minimum value of 0. Maximum value of 100. nextToken A token generated by FinSpace that specifies where to continue pagination if a previous request was truncated. To get the next set of pages, pass in the nextTokennextToken value from the response object of the previous page call. Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: .* Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Content-type: application/json { "environments": [ { "awsAccountId": "string", ListEnvironments 164 Amazon FinSpace Management API Reference "dedicatedServiceAccountId": "string", "description": "string", "environmentArn": "string", "environmentId": "string", "environmentUrl": "string", "federationMode": "string", "federationParameters": { "applicationCallBackURL": "string", "attributeMap": { "string" : "string" }, "federationProviderName": "string", "federationURN": "string", "samlMetadataDocument": "string", "samlMetadataURL": "string" }, "kmsKeyId": "string", "name": "string", "sageMakerStudioDomainUrl": "string", "status": "string" } ], "nextToken": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. environments A list of all of your FinSpace environments. Type: Array of Environment objects nextToken A token that you can use in a subsequent call to retrieve the next set of results. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. ListEnvironments 165 Amazon FinSpace Pattern: .* Errors Management API Reference For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 ListEnvironments 166 Amazon FinSpace Management API Reference ListEnvironments 167 Amazon FinSpace ListKxChangesets Returns a list of all the changesets for a database. Request Syntax GET /kx/environments/environmentId/databases/databaseName/changesets? maxResults=maxResults&nextToken=nextToken HTTP/1.1 Management API Reference URI Request Parameters The request uses the following URI parameters. databaseName The name of the kdb database. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: .*\S.* Required: Yes maxResults The maximum number of results to return in this request. Valid Range: Minimum value of 0. Maximum value of 100. nextToken A token that indicates where a results page should begin. Length Constraints: Minimum length of 1. Maximum length of 1000. ListKxChangesets 168 Management API Reference Amazon FinSpace Pattern: .* Request Body The request does not have a request |
api-reference-032 | api-reference.pdf | 32 | of the kdb database. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: .*\S.* Required: Yes maxResults The maximum number of results to return in this request. Valid Range: Minimum value of 0. Maximum value of 100. nextToken A token that indicates where a results page should begin. Length Constraints: Minimum length of 1. Maximum length of 1000. ListKxChangesets 168 Management API Reference Amazon FinSpace Pattern: .* Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Content-type: application/json { "kxChangesets": [ { "activeFromTimestamp": number, "changesetId": "string", "createdTimestamp": number, "lastModifiedTimestamp": number, "status": "string" } ], "nextToken": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. kxChangesets A list of changesets for a database. Type: Array of KxChangesetListEntry objects nextToken A token that indicates where a results page should begin. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. ListKxChangesets 169 Amazon FinSpace Pattern: .* Errors Management API Reference For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET ListKxChangesets 170 Management API Reference Amazon FinSpace • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 ListKxChangesets 171 Management API Reference Amazon FinSpace ListKxClusterNodes Lists all the nodes in a kdb cluster. Request Syntax GET /kx/environments/environmentId/clusters/clusterName/nodes? maxResults=maxResults&nextToken=nextToken HTTP/1.1 URI Request Parameters The request uses the following URI parameters. clusterName A unique name for the cluster. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ Required: Yes maxResults The maximum number of results to return in this request. Valid Range: Minimum value of 0. Maximum value of 100. nextToken A token that indicates where a results page should begin. Length Constraints: Minimum length of 1. Maximum length of 1000. ListKxClusterNodes 172 Management API Reference Amazon FinSpace Pattern: .* Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Content-type: application/json { "nextToken": "string", "nodes": [ { "availabilityZoneId": "string", "launchTime": number, "nodeId": "string", "status": "string" } ] } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. nextToken A token that indicates where a results page should begin. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: .* nodes A list of nodes associated with the cluster. ListKxClusterNodes 173 Amazon FinSpace Management API Reference Type: Array of KxNode objects Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 LimitExceededException A service limit or quota is exceeded. HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: ListKxClusterNodes 174 Amazon FinSpace Management API Reference • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 ListKxClusterNodes 175 Amazon FinSpace ListKxClusters Returns a list of clusters. Request Syntax Management API Reference GET /kx/environments/environmentId/clusters? clusterType=clusterType&maxResults=maxResults&nextToken=nextToken |
api-reference-033 | api-reference.pdf | 33 | 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: ListKxClusterNodes 174 Amazon FinSpace Management API Reference • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 ListKxClusterNodes 175 Amazon FinSpace ListKxClusters Returns a list of clusters. Request Syntax Management API Reference GET /kx/environments/environmentId/clusters? clusterType=clusterType&maxResults=maxResults&nextToken=nextToken HTTP/1.1 URI Request Parameters The request uses the following URI parameters. clusterType Specifies the type of KDB database that is being created. The following types are available: • HDB – A Historical Database. The data is only accessible with read-only permissions from one of the FinSpace managed kdb databases mounted to the cluster. • RDB – A Realtime Database. This type of database captures all the data from a ticker plant and stores it in memory until the end of day, after which it writes all of its data to a disk and reloads the HDB. This cluster type requires local storage for temporary storage of data during the savedown process. If you specify this field in your request, you must provide the savedownStorageConfiguration parameter. • GATEWAY – A gateway cluster allows you to access data across processes in kdb systems. It allows you to create your own routing logic using the initialization scripts and custom code. This type of cluster does not require a writable local storage. • GP – A general purpose cluster allows you to quickly iterate on code during development by granting greater access to system commands and enabling a fast reload of custom code. This cluster type can optionally mount databases including cache and savedown storage. For this cluster type, the node count is fixed at 1. It does not support autoscaling and supports only SINGLE AZ mode. • Tickerplant – A tickerplant cluster allows you to subscribe to feed handlers based on IAM permissions. It can publish to RDBs, other Tickerplants, and real-time subscribers (RTS). Tickerplants can persist messages to log, which is readable by any RDB environment. It supports only single-node that is only one kdb process. Valid Values: HDB | RDB | GATEWAY | GP | TICKERPLANT ListKxClusters 176 Amazon FinSpace environmentId Management API Reference A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ Required: Yes maxResults The maximum number of results to return in this request. Valid Range: Minimum value of 0. Maximum value of 100. nextToken A token that indicates where a results page should begin. Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: .* Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Content-type: application/json { "kxClusterSummaries": [ { "availabilityZoneId": "string", "azMode": "string", "clusterDescription": "string", "clusterName": "string", "clusterType": "string", "createdTimestamp": number, "executionRole": "string", "initializationScript": "string", ListKxClusters 177 Amazon FinSpace Management API Reference "lastModifiedTimestamp": number, "releaseLabel": "string", "status": "string", "statusReason": "string", "volumes": [ { "volumeName": "string", "volumeType": "string" } ] } ], "nextToken": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. kxClusterSummaries Lists the cluster details. Type: Array of KxCluster objects nextToken A token that indicates where a results page should begin. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: .* Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. ListKxClusters 178 Amazon FinSpace HTTP Status Code: 403 ConflictException Management API Reference There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 LimitExceededException A service limit or quota is exceeded. HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ ListKxClusters 179 Management API Reference Amazon FinSpace • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for |
api-reference-034 | api-reference.pdf | 34 | HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ ListKxClusters 179 Management API Reference Amazon FinSpace • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 ListKxClusters 180 Amazon FinSpace ListKxDatabases Returns a list of all the databases in the kdb environment. Request Syntax Management API Reference GET /kx/environments/environmentId/databases?maxResults=maxResults&nextToken=nextToken HTTP/1.1 URI Request Parameters The request uses the following URI parameters. environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: .*\S.* Required: Yes maxResults The maximum number of results to return in this request. Valid Range: Minimum value of 0. Maximum value of 100. nextToken A token that indicates where a results page should begin. Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: .* Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 ListKxDatabases 181 Amazon FinSpace Management API Reference Content-type: application/json { "kxDatabases": [ { "createdTimestamp": number, "databaseName": "string", "lastModifiedTimestamp": number } ], "nextToken": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. kxDatabases A list of databases in the kdb environment. Type: Array of KxDatabaseListEntry objects nextToken A token that indicates where a results page should begin. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: .* Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ListKxDatabases 182 Amazon FinSpace InternalServerException Management API Reference The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 ListKxDatabases 183 Management API Reference Amazon FinSpace ListKxDataviews Returns a list of all the dataviews in the database. Request Syntax GET /kx/environments/environmentId/databases/databaseName/dataviews? maxResults=maxResults&nextToken=nextToken HTTP/1.1 URI Request Parameters The request uses the following URI parameters. databaseName The name of the database where the dataviews were created. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes environmentId A unique identifier for the kdb environment, for which you want to retrieve a list of dataviews. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: .*\S.* Required: Yes maxResults The maximum number of results to return in this request. Valid Range: Minimum value of 0. Maximum value of 100. nextToken A token that indicates where a results page should begin. Length Constraints: Minimum length of 1. Maximum length of 1000. ListKxDataviews 184 Management API Reference Amazon FinSpace Pattern: .* Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Content-type: application/json { "kxDataviews": [ { "activeVersions": [ { "attachedClusters": [ "string" ], "changesetId": "string", "createdTimestamp": number, "segmentConfigurations": [ { "dbPaths": [ "string" ], "onDemand": boolean, "volumeName": "string" } ], "versionId": "string" } ], "autoUpdate": boolean, "availabilityZoneId": "string", "azMode": "string", "changesetId": "string", "createdTimestamp": number, "databaseName": "string", "dataviewName": "string", "description": "string", "environmentId": "string", "lastModifiedTimestamp": number, "readWrite": boolean, "segmentConfigurations": [ { "dbPaths": [ "string" ], ListKxDataviews 185 Amazon FinSpace Management API Reference "onDemand": boolean, "volumeName": "string" } ], "status": "string", "statusReason": "string" } ], "nextToken": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. kxDataviews The list of kdb dataviews that are currently active for the given database. Type: Array of KxDataviewListEntry objects nextToken A token that indicates where a results page should begin. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: .* Errors For information about the errors that are common to all actions, see |
api-reference-035 | api-reference.pdf | 35 | API Reference "onDemand": boolean, "volumeName": "string" } ], "status": "string", "statusReason": "string" } ], "nextToken": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. kxDataviews The list of kdb dataviews that are currently active for the given database. Type: Array of KxDataviewListEntry objects nextToken A token that indicates where a results page should begin. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: .* Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ListKxDataviews 186 Amazon FinSpace InternalServerException Management API Reference The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 ListKxDataviews 187 Amazon FinSpace ListKxEnvironments Returns a list of kdb environments created in an account. Request Syntax Management API Reference GET /kx/environments?maxResults=maxResults&nextToken=nextToken HTTP/1.1 URI Request Parameters The request uses the following URI parameters. maxResults The maximum number of results to return in this request. nextToken A token that indicates where a results page should begin. Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: .* Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Content-type: application/json { "environments": [ { "availabilityZoneIds": [ "string" ], "awsAccountId": "string", "certificateAuthorityArn": "string", "creationTimestamp": number, "customDNSConfiguration": [ { "customDNSServerIP": "string", ListKxEnvironments 188 Amazon FinSpace Management API Reference "customDNSServerName": "string" } ], "dedicatedServiceAccountId": "string", "description": "string", "dnsStatus": "string", "environmentArn": "string", "environmentId": "string", "errorMessage": "string", "kmsKeyId": "string", "name": "string", "status": "string", "tgwStatus": "string", "transitGatewayConfiguration": { "attachmentNetworkAclConfiguration": [ { "cidrBlock": "string", "icmpTypeCode": { "code": number, "type": number }, "portRange": { "from": number, "to": number }, "protocol": "string", "ruleAction": "string", "ruleNumber": number } ], "routableCIDRSpace": "string", "transitGatewayID": "string" }, "updateTimestamp": number } ], "nextToken": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. ListKxEnvironments 189 Amazon FinSpace environments A list of environments in an account. Type: Array of KxEnvironment objects nextToken Management API Reference A token that indicates where a results page should begin. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: .* Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface ListKxEnvironments 190 Management API Reference Amazon FinSpace • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 ListKxEnvironments 191 Management API Reference Amazon FinSpace ListKxScalingGroups Returns a list of scaling groups in a kdb environment. Request Syntax GET /kx/environments/environmentId/scalingGroups? maxResults=maxResults&nextToken=nextToken HTTP/1.1 URI Request Parameters The request uses the following URI parameters. environmentId A unique identifier for the kdb environment, for which you want to retrieve a list of scaling groups. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ Required: Yes maxResults The maximum number of results to return in this request. Valid Range: Minimum value of 0. Maximum value of 100. nextToken A token that indicates where a results page should begin. Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: .* Request Body The request does not have a request body. ListKxScalingGroups 192 Management API Reference Amazon FinSpace Response Syntax HTTP/1.1 200 Content-type: application/json { "nextToken": "string", "scalingGroups": [ { "availabilityZoneId": "string", "clusters": [ "string" ], "createdTimestamp": number, "hostType": "string", "lastModifiedTimestamp": |
api-reference-036 | api-reference.pdf | 36 | scaling groups. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ Required: Yes maxResults The maximum number of results to return in this request. Valid Range: Minimum value of 0. Maximum value of 100. nextToken A token that indicates where a results page should begin. Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: .* Request Body The request does not have a request body. ListKxScalingGroups 192 Management API Reference Amazon FinSpace Response Syntax HTTP/1.1 200 Content-type: application/json { "nextToken": "string", "scalingGroups": [ { "availabilityZoneId": "string", "clusters": [ "string" ], "createdTimestamp": number, "hostType": "string", "lastModifiedTimestamp": number, "scalingGroupName": "string", "status": "string", "statusReason": "string" } ] } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. nextToken A token that indicates where a results page should begin. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: .* scalingGroups A list of scaling groups available in a kdb environment. Type: Array of KxScalingGroup objects ListKxScalingGroups 193 Amazon FinSpace Errors Management API Reference For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 LimitExceededException A service limit or quota is exceeded. HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 ListKxScalingGroups 194 Amazon FinSpace See Also Management API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 ListKxScalingGroups 195 Amazon FinSpace ListKxUsers Lists all the users in a kdb environment. Request Syntax Management API Reference GET /kx/environments/environmentId/users?maxResults=maxResults&nextToken=nextToken HTTP/1.1 URI Request Parameters The request uses the following URI parameters. environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: Yes maxResults The maximum number of results to return in this request. Valid Range: Minimum value of 0. Maximum value of 100. nextToken A token that indicates where a results page should begin. Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: .* Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 ListKxUsers 196 Amazon FinSpace Management API Reference Content-type: application/json { "nextToken": "string", "users": [ { "createTimestamp": number, "iamRole": "string", "updateTimestamp": number, "userArn": "string", "userName": "string" } ] } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. nextToken A token that indicates where a results page should begin. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: .* users A list of users in a kdb environment. Type: Array of KxUser objects Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. ListKxUsers 197 Amazon FinSpace HTTP Status Code: 403 InternalServerException Management API Reference The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 ListKxUsers 198 Amazon FinSpace Management API Reference ListKxUsers 199 Amazon FinSpace ListKxVolumes Lists all the volumes in a kdb environment. Request Syntax Management API Reference GET /kx/environments/environmentId/kxvolumes? maxResults=maxResults&nextToken=nextToken&volumeType=volumeType HTTP/1.1 URI Request Parameters The request uses the following URI parameters. environmentId |
api-reference-037 | api-reference.pdf | 37 | AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 ListKxUsers 198 Amazon FinSpace Management API Reference ListKxUsers 199 Amazon FinSpace ListKxVolumes Lists all the volumes in a kdb environment. Request Syntax Management API Reference GET /kx/environments/environmentId/kxvolumes? maxResults=maxResults&nextToken=nextToken&volumeType=volumeType HTTP/1.1 URI Request Parameters The request uses the following URI parameters. environmentId A unique identifier for the kdb environment, whose clusters can attach to the volume. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ Required: Yes maxResults The maximum number of results to return in this request. Valid Range: Minimum value of 0. Maximum value of 100. nextToken A token that indicates where a results page should begin. Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: .* volumeType The type of file system volume. Currently, FinSpace only supports NAS_1 volume type. Valid Values: NAS_1 ListKxVolumes 200 Management API Reference Amazon FinSpace Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Content-type: application/json { "kxVolumeSummaries": [ { "availabilityZoneIds": [ "string" ], "azMode": "string", "createdTimestamp": number, "description": "string", "lastModifiedTimestamp": number, "status": "string", "statusReason": "string", "volumeName": "string", "volumeType": "string" } ], "nextToken": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. kxVolumeSummaries A summary of volumes. Type: Array of KxVolume objects nextToken A token that indicates where a results page should begin. Type: String ListKxVolumes 201 Amazon FinSpace Management API Reference Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: .* Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 LimitExceededException A service limit or quota is exceeded. HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. ListKxVolumes 202 Amazon FinSpace HTTP Status Code: 400 See Also Management API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 ListKxVolumes 203 Management API Reference Amazon FinSpace ListTagsForResource A list of all tags for a resource. Request Syntax GET /tags/resourceArn HTTP/1.1 URI Request Parameters The request uses the following URI parameters. resourceArn The Amazon Resource Name of the resource. Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\d+:(environment| kxEnvironment)/[0-9A-Za-z_-]{1,128}(/(kxCluster|kxUser|kxVolume| kxScalingGroup)/[a-zA-Z0-9_-]{1,255}|/(kxDatabase/[a-zA-Z0-9_-]{1,255}(/ kxDataview/[a-zA-Z0-9_-]{1,255})?))?$ Required: Yes Request Body The request does not have a request body. Response Syntax HTTP/1.1 200 Content-type: application/json { "tags": { "string" : "string" } } ListTagsForResource 204 Amazon FinSpace Response Elements Management API Reference If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. tags A list of all tags for a resource. Type: String to string map Map Entries: Maximum number of 50 items. Key Length Constraints: Minimum length of 1. Maximum length of 128. Key Pattern: ^(?!aws:)[a-zA-Z+-=._:/]+$ Value Length Constraints: Minimum length of 1. Maximum length of 256. Value Pattern: ^[a-zA-Z0-9+-=._:@ ]+$ Errors For information about the errors that are common to all actions, see Common Errors. InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 InvalidRequestException The request is invalid. Something is wrong with the input to the request. HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ListTagsForResource 205 Amazon FinSpace See Also Management API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin |
api-reference-038 | api-reference.pdf | 38 | or failure. HTTP Status Code: 500 InvalidRequestException The request is invalid. Something is wrong with the input to the request. HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ListTagsForResource 205 Amazon FinSpace See Also Management API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 ListTagsForResource 206 Management API Reference Amazon FinSpace TagResource Adds metadata tags to a FinSpace resource. Request Syntax POST /tags/resourceArn HTTP/1.1 Content-type: application/json { "tags": { "string" : "string" } } URI Request Parameters The request uses the following URI parameters. resourceArn The Amazon Resource Name (ARN) for the resource. Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\d+:(environment| kxEnvironment)/[0-9A-Za-z_-]{1,128}(/(kxCluster|kxUser|kxVolume| kxScalingGroup)/[a-zA-Z0-9_-]{1,255}|/(kxDatabase/[a-zA-Z0-9_-]{1,255}(/ kxDataview/[a-zA-Z0-9_-]{1,255})?))?$ Required: Yes Request Body The request accepts the following data in JSON format. tags One or more tags to be assigned to the resource. Type: String to string map TagResource 207 Amazon FinSpace Management API Reference Map Entries: Maximum number of 50 items. Key Length Constraints: Minimum length of 1. Maximum length of 128. Key Pattern: ^(?!aws:)[a-zA-Z+-=._:/]+$ Value Length Constraints: Minimum length of 1. Maximum length of 256. Value Pattern: ^[a-zA-Z0-9+-=._:@ ]+$ Required: Yes Response Syntax HTTP/1.1 200 Response Elements If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. Errors For information about the errors that are common to all actions, see Common Errors. InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 InvalidRequestException The request is invalid. Something is wrong with the input to the request. HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 TagResource 208 Amazon FinSpace See Also Management API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 TagResource 209 Management API Reference Amazon FinSpace UntagResource Removes metadata tags from a FinSpace resource. Request Syntax DELETE /tags/resourceArn?tagKeys=tagKeys HTTP/1.1 URI Request Parameters The request uses the following URI parameters. resourceArn A FinSpace resource from which you want to remove a tag or tags. The value for this parameter is an Amazon Resource Name (ARN). Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\d+:(environment| kxEnvironment)/[0-9A-Za-z_-]{1,128}(/(kxCluster|kxUser|kxVolume| kxScalingGroup)/[a-zA-Z0-9_-]{1,255}|/(kxDatabase/[a-zA-Z0-9_-]{1,255}(/ kxDataview/[a-zA-Z0-9_-]{1,255})?))?$ Required: Yes tagKeys The tag keys (names) of one or more tags to be removed. Array Members: Minimum number of 1 item. Maximum number of 50 items. Length Constraints: Minimum length of 1. Maximum length of 128. Pattern: ^(?!aws:)[a-zA-Z+-=._:/]+$ Required: Yes Request Body The request does not have a request body. UntagResource 210 Amazon FinSpace Response Syntax HTTP/1.1 200 Response Elements Management API Reference If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. Errors For information about the errors that are common to all actions, see Common Errors. InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 InvalidRequestException The request is invalid. Something is wrong with the input to the request. HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 UntagResource 211 Amazon FinSpace • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Management API Reference UntagResource 212 Management API Reference Amazon FinSpace UpdateEnvironment Update your FinSpace environment. Request Syntax PUT /environment/environmentId HTTP/1.1 Content-type: application/json { "description": "string", "federationMode": "string", "federationParameters": { "applicationCallBackURL": "string", "attributeMap": { "string" : "string" }, "federationProviderName": "string", "federationURN": "string", "samlMetadataDocument": "string", "samlMetadataURL": "string" }, "name": "string" } URI Request Parameters The request uses the following URI parameters. environmentId The identifier of the FinSpace environment. Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: Yes Request Body The request |
api-reference-039 | api-reference.pdf | 39 | AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Management API Reference UntagResource 212 Management API Reference Amazon FinSpace UpdateEnvironment Update your FinSpace environment. Request Syntax PUT /environment/environmentId HTTP/1.1 Content-type: application/json { "description": "string", "federationMode": "string", "federationParameters": { "applicationCallBackURL": "string", "attributeMap": { "string" : "string" }, "federationProviderName": "string", "federationURN": "string", "samlMetadataDocument": "string", "samlMetadataURL": "string" }, "name": "string" } URI Request Parameters The request uses the following URI parameters. environmentId The identifier of the FinSpace environment. Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: Yes Request Body The request accepts the following data in JSON format. UpdateEnvironment 213 Management API Reference Amazon FinSpace description The description of the environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ Required: No federationMode Authentication mode for the environment. • FEDERATED - Users access FinSpace through Single Sign On (SSO) via your Identity provider. • LOCAL - Users access FinSpace via email and password managed within the FinSpace environment. Type: String Valid Values: FEDERATED | LOCAL Required: No federationParameters Configuration information when authentication mode is FEDERATED. Type: FederationParameters object Required: No name The name of the environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]$ UpdateEnvironment 214 Management API Reference Amazon FinSpace Required: No Response Syntax HTTP/1.1 200 Content-type: application/json { "environment": { "awsAccountId": "string", "dedicatedServiceAccountId": "string", "description": "string", "environmentArn": "string", "environmentId": "string", "environmentUrl": "string", "federationMode": "string", "federationParameters": { "applicationCallBackURL": "string", "attributeMap": { "string" : "string" }, "federationProviderName": "string", "federationURN": "string", "samlMetadataDocument": "string", "samlMetadataURL": "string" }, "kmsKeyId": "string", "name": "string", "sageMakerStudioDomainUrl": "string", "status": "string" } } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. environment Returns the FinSpace environment object. UpdateEnvironment 215 Amazon FinSpace Management API Reference Type: Environment object Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET UpdateEnvironment 216 Management API Reference Amazon FinSpace • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 UpdateEnvironment 217 Amazon FinSpace Management API Reference UpdateKxClusterCodeConfiguration Allows you to update code configuration on a running cluster. By using this API you can update the code, the initialization script path, and the command line arguments for a specific cluster. The configuration that you want to update will override any existing configurations on the cluster. Request Syntax PUT /kx/environments/environmentId/clusters/clusterName/configuration/code HTTP/1.1 Content-type: application/json { "clientToken": "string", "code": { "s3Bucket": "string", "s3Key": "string", "s3ObjectVersion": "string" }, "commandLineArguments": [ { "key": "string", "value": "string" } ], "deploymentConfiguration": { "deploymentStrategy": "string" }, "initializationScript": "string" } URI Request Parameters The request uses the following URI parameters. clusterName The name of the cluster. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes UpdateKxClusterCodeConfiguration 218 Amazon FinSpace environmentId Management API Reference A unique identifier of the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ Required: Yes Request Body The request accepts the following data in JSON format. code The structure of the customer code available within the running cluster. Type: CodeConfiguration object Required: Yes clientToken A token that ensures idempotency. This token expires in 10 minutes. Type: String Length Constraints: Minimum length of 1. Maximum length of 64. Pattern: ^[a-zA-Z0-9-]+$ Required: No commandLineArguments Specifies the key-value pairs to make them available inside the cluster. You cannot update this parameter for a NO_RESTART deployment. Type: Array of KxCommandLineArgument objects Required: No UpdateKxClusterCodeConfiguration 219 Amazon FinSpace deploymentConfiguration Management API Reference The configuration that allows you to choose how you want to update the code on a cluster. Type: KxClusterCodeDeploymentConfiguration object Required: No initializationScript Specifies a Q program that will be run at launch of a cluster. It is a relative path within .zip file that contains the custom code, which will be loaded on the cluster. It must include the file name itself. For example, somedir/init.q. You cannot update |
api-reference-040 | api-reference.pdf | 40 | to make them available inside the cluster. You cannot update this parameter for a NO_RESTART deployment. Type: Array of KxCommandLineArgument objects Required: No UpdateKxClusterCodeConfiguration 219 Amazon FinSpace deploymentConfiguration Management API Reference The configuration that allows you to choose how you want to update the code on a cluster. Type: KxClusterCodeDeploymentConfiguration object Required: No initializationScript Specifies a Q program that will be run at launch of a cluster. It is a relative path within .zip file that contains the custom code, which will be loaded on the cluster. It must include the file name itself. For example, somedir/init.q. You cannot update this parameter for a NO_RESTART deployment. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: ^[a-zA-Z0-9\_\-\.\/\\]+$ Required: No Response Syntax HTTP/1.1 200 Response Elements If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 UpdateKxClusterCodeConfiguration 220 Amazon FinSpace ConflictException Management API Reference There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 LimitExceededException A service limit or quota is exceeded. HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 UpdateKxClusterCodeConfiguration 221 Amazon FinSpace • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Management API Reference UpdateKxClusterCodeConfiguration 222 Amazon FinSpace Management API Reference UpdateKxClusterDatabases Updates the databases mounted on a kdb cluster, which includes the changesetId and all the dbPaths to be cached. This API does not allow you to change a database name or add a database if you created a cluster without one. Using this API you can point a cluster to a different changeset and modify a list of partitions being cached. Request Syntax PUT /kx/environments/environmentId/clusters/clusterName/configuration/databases HTTP/1.1 Content-type: application/json { "clientToken": "string", "databases": [ { "cacheConfigurations": [ { "cacheType": "string", "dataviewName": "string", "dbPaths": [ "string" ] } ], "changesetId": "string", "databaseName": "string", "dataviewConfiguration": { "changesetId": "string", "dataviewName": "string", "dataviewVersionId": "string", "segmentConfigurations": [ { "dbPaths": [ "string" ], "onDemand": boolean, "volumeName": "string" } ] }, "dataviewName": "string" } ], UpdateKxClusterDatabases 223 Amazon FinSpace Management API Reference "deploymentConfiguration": { "deploymentStrategy": "string" } } URI Request Parameters The request uses the following URI parameters. clusterName A unique name for the cluster that you want to modify. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes environmentId The unique identifier of a kdb environment. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ Required: Yes Request Body The request accepts the following data in JSON format. databases The structure of databases mounted on the cluster. Type: Array of KxDatabaseConfiguration objects Required: Yes clientToken A token that ensures idempotency. This token expires in 10 minutes. UpdateKxClusterDatabases 224 Amazon FinSpace Type: String Management API Reference Length Constraints: Minimum length of 1. Maximum length of 64. Pattern: ^[a-zA-Z0-9-]+$ Required: No deploymentConfiguration The configuration that allows you to choose how you want to update the databases on a cluster. Type: KxDeploymentConfiguration object Required: No Response Syntax HTTP/1.1 200 Response Elements If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body. Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. UpdateKxClusterDatabases 225 Management API Reference Amazon FinSpace HTTP Status Code: 500 LimitExceededException A service limit or quota is exceeded. HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific |
api-reference-041 | api-reference.pdf | 41 | not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. UpdateKxClusterDatabases 225 Management API Reference Amazon FinSpace HTTP Status Code: 500 LimitExceededException A service limit or quota is exceeded. HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 UpdateKxClusterDatabases 226 Amazon FinSpace Management API Reference UpdateKxClusterDatabases 227 Amazon FinSpace UpdateKxDatabase Updates information for the given kdb database. Request Syntax PUT /kx/environments/environmentId/databases/databaseName HTTP/1.1 Content-type: application/json Management API Reference { "clientToken": "string", "description": "string" } URI Request Parameters The request uses the following URI parameters. databaseName The name of the kdb database. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: .*\S.* Required: Yes Request Body The request accepts the following data in JSON format. UpdateKxDatabase 228 Amazon FinSpace clientToken Management API Reference A token that ensures idempotency. This token expires in 10 minutes. Type: String Length Constraints: Minimum length of 1. Maximum length of 64. Pattern: ^[a-zA-Z0-9-]+$ Required: Yes description A description of the database. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ Required: No Response Syntax HTTP/1.1 200 Content-type: application/json { "databaseName": "string", "description": "string", "environmentId": "string", "lastModifiedTimestamp": number } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. UpdateKxDatabase 229 Management API Reference Amazon FinSpace databaseName The name of the kdb database. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ description A description of the database. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ environmentId A unique identifier for the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: .*\S.* lastModifiedTimestamp The last time that the database was modified. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. UpdateKxDatabase 230 Amazon FinSpace HTTP Status Code: 403 ConflictException Management API Reference There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 UpdateKxDatabase 231 Amazon FinSpace • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Management API Reference UpdateKxDatabase 232 Amazon FinSpace UpdateKxDataview Management API Reference Updates the specified dataview. The dataviews get automatically updated when any new changesets are ingested. Each update of the dataview creates a new version, including changeset details and cache configurations Request Syntax PUT /kx/environments/environmentId/databases/databaseName/dataviews/dataviewName HTTP/1.1 Content-type: application/json { "changesetId": "string", "clientToken": "string", "description": "string", "segmentConfigurations": [ { "dbPaths": [ "string" ], "onDemand": boolean, "volumeName": "string" } ] } URI Request Parameters The request uses the following URI parameters. databaseName The name of the database. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes dataviewName The name of the dataview that you want to update. Length Constraints: Minimum length of 3. Maximum length of 63. UpdateKxDataview 233 Amazon FinSpace Management API Reference Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes environmentId A unique identifier for the kdb environment, where you |
api-reference-042 | api-reference.pdf | 42 | Request Syntax PUT /kx/environments/environmentId/databases/databaseName/dataviews/dataviewName HTTP/1.1 Content-type: application/json { "changesetId": "string", "clientToken": "string", "description": "string", "segmentConfigurations": [ { "dbPaths": [ "string" ], "onDemand": boolean, "volumeName": "string" } ] } URI Request Parameters The request uses the following URI parameters. databaseName The name of the database. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes dataviewName The name of the dataview that you want to update. Length Constraints: Minimum length of 3. Maximum length of 63. UpdateKxDataview 233 Amazon FinSpace Management API Reference Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes environmentId A unique identifier for the kdb environment, where you want to update the dataview. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: .*\S.* Required: Yes Request Body The request accepts the following data in JSON format. clientToken A token that ensures idempotency. This token expires in 10 minutes. Type: String Length Constraints: Minimum length of 1. Maximum length of 64. Pattern: ^[a-zA-Z0-9-]+$ Required: Yes changesetId A unique identifier for the changeset. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]+$ Required: No description The description for a dataview. UpdateKxDataview 234 Amazon FinSpace Type: String Management API Reference Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ Required: No segmentConfigurations The configuration that contains the database path of the data that you want to place on each selected volume. Each segment must have a unique database path for each volume. If you do not explicitly specify any database path for a volume, they are accessible from the cluster through the default S3/object store segment. Type: Array of KxDataviewSegmentConfiguration objects Array Members: Minimum number of 0 items. Maximum number of 50 items. Required: No Response Syntax HTTP/1.1 200 Content-type: application/json { "activeVersions": [ { "attachedClusters": [ "string" ], "changesetId": "string", "createdTimestamp": number, "segmentConfigurations": [ { "dbPaths": [ "string" ], "onDemand": boolean, "volumeName": "string" } ], "versionId": "string" } ], "autoUpdate": boolean, UpdateKxDataview 235 Amazon FinSpace Management API Reference "availabilityZoneId": "string", "azMode": "string", "changesetId": "string", "createdTimestamp": number, "databaseName": "string", "dataviewName": "string", "description": "string", "environmentId": "string", "lastModifiedTimestamp": number, "readWrite": boolean, "segmentConfigurations": [ { "dbPaths": [ "string" ], "onDemand": boolean, "volumeName": "string" } ], "status": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. activeVersions The current active changeset versions of the database on the given dataview. Type: Array of KxDataviewActiveVersion objects autoUpdate The option to specify whether you want to apply all the future additions and corrections automatically to the dataview when new changesets are ingested. The default value is false. Type: Boolean availabilityZoneId The identifier of the availability zones. Type: String UpdateKxDataview 236 Amazon FinSpace Management API Reference Length Constraints: Minimum length of 8. Maximum length of 12. Pattern: ^[a-zA-Z0-9-]+$ azMode The number of availability zones you want to assign per volume. Currently, FinSpace only supports SINGLE for volumes. This places dataview in a single AZ. Type: String Valid Values: SINGLE | MULTI changesetId A unique identifier for the changeset. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]+$ createdTimestamp The timestamp at which the dataview was created in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp databaseName The name of the database. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ dataviewName The name of the database under which the dataview was created. Type: String UpdateKxDataview 237 Amazon FinSpace Management API Reference Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ description A description of the dataview. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ environmentId A unique identifier for the kdb environment, where you want to update the dataview. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: .*\S.* lastModifiedTimestamp The last time that the dataview was updated in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp readWrite Returns True if the dataview is created as writeable and False otherwise. Type: Boolean segmentConfigurations The configuration that contains the database path of the data that you want to place on each selected volume. Each segment must have a unique database path for each volume. If you do not explicitly specify any database path for a volume, they are accessible from the cluster through the default S3/object store segment. Type: Array of KxDataviewSegmentConfiguration objects UpdateKxDataview 238 Amazon FinSpace Management API Reference Array Members: Minimum number of 0 items. Maximum number of 50 items. status The status of |
api-reference-043 | api-reference.pdf | 43 | Type: Timestamp readWrite Returns True if the dataview is created as writeable and False otherwise. Type: Boolean segmentConfigurations The configuration that contains the database path of the data that you want to place on each selected volume. Each segment must have a unique database path for each volume. If you do not explicitly specify any database path for a volume, they are accessible from the cluster through the default S3/object store segment. Type: Array of KxDataviewSegmentConfiguration objects UpdateKxDataview 238 Amazon FinSpace Management API Reference Array Members: Minimum number of 0 items. Maximum number of 50 items. status The status of dataview creation. • CREATING – The dataview creation is in progress. • UPDATING – The dataview is in the process of being updated. • ACTIVE – The dataview is active. Type: String Valid Values: CREATING | ACTIVE | UPDATING | FAILED | DELETING Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceAlreadyExistsException The specified resource group already exists. HTTP Status Code: 409 ResourceNotFoundException One or more resources can't be found. UpdateKxDataview 239 Management API Reference Amazon FinSpace HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 UpdateKxDataview 240 Amazon FinSpace Management API Reference UpdateKxEnvironment Updates information for the given kdb environment. Request Syntax PUT /kx/environments/environmentId HTTP/1.1 Content-type: application/json { "clientToken": "string", "description": "string", "name": "string" } URI Request Parameters The request uses the following URI parameters. environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: Yes Request Body The request accepts the following data in JSON format. clientToken A token that ensures idempotency. This token expires in 10 minutes. Type: String Length Constraints: Minimum length of 1. Maximum length of 36. Pattern: .*\S.* UpdateKxEnvironment 241 Management API Reference Amazon FinSpace Required: No description A description of the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ Required: No name The name of the kdb environment. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: No Response Syntax HTTP/1.1 200 Content-type: application/json { "availabilityZoneIds": [ "string" ], "awsAccountId": "string", "creationTimestamp": number, "customDNSConfiguration": [ { "customDNSServerIP": "string", "customDNSServerName": "string" } ], "dedicatedServiceAccountId": "string", "description": "string", UpdateKxEnvironment 242 Amazon FinSpace Management API Reference "dnsStatus": "string", "environmentArn": "string", "environmentId": "string", "errorMessage": "string", "kmsKeyId": "string", "name": "string", "status": "string", "tgwStatus": "string", "transitGatewayConfiguration": { "attachmentNetworkAclConfiguration": [ { "cidrBlock": "string", "icmpTypeCode": { "code": number, "type": number }, "portRange": { "from": number, "to": number }, "protocol": "string", "ruleAction": "string", "ruleNumber": number } ], "routableCIDRSpace": "string", "transitGatewayID": "string" }, "updateTimestamp": number } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. availabilityZoneIds The identifier of the availability zones where subnets for the environment are created. Type: Array of strings Length Constraints: Minimum length of 8. Maximum length of 12. UpdateKxEnvironment 243 Amazon FinSpace Management API Reference Pattern: ^[a-zA-Z0-9-]+$ awsAccountId The unique identifier of the AWS account that is used to create the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ creationTimestamp The timestamp at which the kdb environment was created in FinSpace. Type: Timestamp customDNSConfiguration A list of DNS server name and server IP. This is used to set up Route-53 outbound resolvers. Type: Array of CustomDNSServer objects dedicatedServiceAccountId A unique identifier for the AWS environment infrastructure account. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ description The description of the environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ dnsStatus The status of DNS configuration. UpdateKxEnvironment 244 Amazon FinSpace Type: String Management API Reference Valid Values: NONE | UPDATE_REQUESTED | UPDATING | FAILED_UPDATE | SUCCESSFULLY_UPDATED environmentArn The ARN identifier of the environment. Type: String Length Constraints: Minimum |
api-reference-044 | api-reference.pdf | 44 | and server IP. This is used to set up Route-53 outbound resolvers. Type: Array of CustomDNSServer objects dedicatedServiceAccountId A unique identifier for the AWS environment infrastructure account. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ description The description of the environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ dnsStatus The status of DNS configuration. UpdateKxEnvironment 244 Amazon FinSpace Type: String Management API Reference Valid Values: NONE | UPDATE_REQUESTED | UPDATING | FAILED_UPDATE | SUCCESSFULLY_UPDATED environmentArn The ARN identifier of the environment. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\d+:environment/[0-9A-Za- z_-]{1,128}$ environmentId A unique identifier for the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ errorMessage Specifies the error message that appears if a flow fails. Type: String Length Constraints: Minimum length of 0. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ kmsKeyId The KMS key ID to encrypt your data in the FinSpace environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z-0-9-:\/]*$ UpdateKxEnvironment 245 Management API Reference Amazon FinSpace name The name of the kdb environment. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ status The status of the kdb environment. Type: String Valid Values: CREATE_REQUESTED | CREATING | CREATED | DELETE_REQUESTED | DELETING | DELETED | FAILED_CREATION | RETRY_DELETION | FAILED_DELETION | UPDATE_NETWORK_REQUESTED | UPDATING_NETWORK | FAILED_UPDATING_NETWORK | SUSPENDED tgwStatus The status of the network configuration. Type: String Valid Values: NONE | UPDATE_REQUESTED | UPDATING | FAILED_UPDATE | SUCCESSFULLY_UPDATED transitGatewayConfiguration The structure of the transit gateway and network configuration that is used to connect the kdb environment to an internal network. Type: TransitGatewayConfiguration object updateTimestamp The timestamp at which the kdb environment was updated. Type: Timestamp Errors For information about the errors that are common to all actions, see Common Errors. UpdateKxEnvironment 246 Amazon FinSpace AccessDeniedException Management API Reference You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 UpdateKxEnvironment 247 Amazon FinSpace • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Management API Reference UpdateKxEnvironment 248 Amazon FinSpace Management API Reference UpdateKxEnvironmentNetwork Updates environment network to connect to your internal network by using a transit gateway. This API supports request to create a transit gateway attachment from FinSpace VPC to your transit gateway ID and create a custom Route-53 outbound resolvers. Once you send a request to update a network, you cannot change it again. Network update might require termination of any clusters that are running in the existing network. Request Syntax PUT /kx/environments/environmentId/network HTTP/1.1 Content-type: application/json { "clientToken": "string", "customDNSConfiguration": [ { "customDNSServerIP": "string", "customDNSServerName": "string" } ], "transitGatewayConfiguration": { "attachmentNetworkAclConfiguration": [ { "cidrBlock": "string", "icmpTypeCode": { "code": number, "type": number }, "portRange": { "from": number, "to": number }, "protocol": "string", "ruleAction": "string", "ruleNumber": number } ], "routableCIDRSpace": "string", "transitGatewayID": "string" } UpdateKxEnvironmentNetwork 249 Management API Reference Amazon FinSpace } URI Request Parameters The request uses the following URI parameters. environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: Yes Request Body The request accepts the following data in JSON format. clientToken A token that ensures idempotency. This token expires in 10 minutes. Type: String Length Constraints: Minimum length of 1. Maximum length of 36. Pattern: .*\S.* Required: No customDNSConfiguration A list of DNS server name and server IP. This is used to set up Route-53 outbound resolvers. Type: Array of CustomDNSServer objects Required: No transitGatewayConfiguration Specifies the transit gateway and network configuration to connect the kdb environment to an internal network. UpdateKxEnvironmentNetwork 250 Amazon FinSpace Management API Reference Type: TransitGatewayConfiguration object Required: No Response Syntax HTTP/1.1 200 Content-type: application/json { "availabilityZoneIds": [ "string" ], "awsAccountId": "string", "creationTimestamp": number, "customDNSConfiguration": [ { "customDNSServerIP": "string", "customDNSServerName": "string" } ], "dedicatedServiceAccountId": "string", "description": "string", "dnsStatus": "string", "environmentArn": "string", "environmentId": "string", "errorMessage": |
api-reference-045 | api-reference.pdf | 45 | of 1. Maximum length of 36. Pattern: .*\S.* Required: No customDNSConfiguration A list of DNS server name and server IP. This is used to set up Route-53 outbound resolvers. Type: Array of CustomDNSServer objects Required: No transitGatewayConfiguration Specifies the transit gateway and network configuration to connect the kdb environment to an internal network. UpdateKxEnvironmentNetwork 250 Amazon FinSpace Management API Reference Type: TransitGatewayConfiguration object Required: No Response Syntax HTTP/1.1 200 Content-type: application/json { "availabilityZoneIds": [ "string" ], "awsAccountId": "string", "creationTimestamp": number, "customDNSConfiguration": [ { "customDNSServerIP": "string", "customDNSServerName": "string" } ], "dedicatedServiceAccountId": "string", "description": "string", "dnsStatus": "string", "environmentArn": "string", "environmentId": "string", "errorMessage": "string", "kmsKeyId": "string", "name": "string", "status": "string", "tgwStatus": "string", "transitGatewayConfiguration": { "attachmentNetworkAclConfiguration": [ { "cidrBlock": "string", "icmpTypeCode": { "code": number, "type": number }, "portRange": { "from": number, "to": number }, "protocol": "string", "ruleAction": "string", UpdateKxEnvironmentNetwork 251 Amazon FinSpace Management API Reference "ruleNumber": number } ], "routableCIDRSpace": "string", "transitGatewayID": "string" }, "updateTimestamp": number } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. availabilityZoneIds The identifier of the availability zones where subnets for the environment are created. Type: Array of strings Length Constraints: Minimum length of 8. Maximum length of 12. Pattern: ^[a-zA-Z0-9-]+$ awsAccountId The unique identifier of the AWS account that is used to create the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ creationTimestamp The timestamp at which the kdb environment was created in FinSpace. Type: Timestamp customDNSConfiguration A list of DNS server name and server IP. This is used to set up Route-53 outbound resolvers. Type: Array of CustomDNSServer objects UpdateKxEnvironmentNetwork 252 Amazon FinSpace dedicatedServiceAccountId Management API Reference A unique identifier for the AWS environment infrastructure account. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ description The description of the environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ dnsStatus The status of DNS configuration. Type: String Valid Values: NONE | UPDATE_REQUESTED | UPDATING | FAILED_UPDATE | SUCCESSFULLY_UPDATED environmentArn The ARN identifier of the environment. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\d+:environment/[0-9A-Za- z_-]{1,128}$ environmentId A unique identifier for the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. UpdateKxEnvironmentNetwork 253 Amazon FinSpace Management API Reference Pattern: ^[a-zA-Z0-9]{1,26}$ errorMessage Specifies the error message that appears if a flow fails. Type: String Length Constraints: Minimum length of 0. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ kmsKeyId The KMS key ID to encrypt your data in the FinSpace environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z-0-9-:\/]*$ name The name of the kdb environment. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ status The status of the kdb environment. Type: String Valid Values: CREATE_REQUESTED | CREATING | CREATED | DELETE_REQUESTED | DELETING | DELETED | FAILED_CREATION | RETRY_DELETION | FAILED_DELETION | UPDATE_NETWORK_REQUESTED | UPDATING_NETWORK | FAILED_UPDATING_NETWORK | SUSPENDED tgwStatus The status of the network configuration. UpdateKxEnvironmentNetwork 254 Amazon FinSpace Type: String Management API Reference Valid Values: NONE | UPDATE_REQUESTED | UPDATING | FAILED_UPDATE | SUCCESSFULLY_UPDATED transitGatewayConfiguration The structure of the transit gateway and network configuration that is used to connect the kdb environment to an internal network. Type: TransitGatewayConfiguration object updateTimestamp The timestamp at which the kdb environment was updated. Type: Timestamp Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 UpdateKxEnvironmentNetwork 255 Management API Reference Amazon FinSpace ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 UpdateKxEnvironmentNetwork 256 Amazon FinSpace UpdateKxUser Management API Reference Updates the user details. You can only update the IAM role associated with a user. Request Syntax PUT /kx/environments/environmentId/users/userName HTTP/1.1 Content-type: application/json { "clientToken": "string", "iamRole": "string" } URI Request |
api-reference-046 | api-reference.pdf | 46 | the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 UpdateKxEnvironmentNetwork 256 Amazon FinSpace UpdateKxUser Management API Reference Updates the user details. You can only update the IAM role associated with a user. Request Syntax PUT /kx/environments/environmentId/users/userName HTTP/1.1 Content-type: application/json { "clientToken": "string", "iamRole": "string" } URI Request Parameters The request uses the following URI parameters. environmentId A unique identifier for the kdb environment. Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: Yes userName A unique identifier for the user. Length Constraints: Minimum length of 1. Maximum length of 50. Pattern: ^[0-9A-Za-z_-]{1,50}$ Required: Yes Request Body The request accepts the following data in JSON format. UpdateKxUser 257 Amazon FinSpace iamRole The IAM role ARN that is associated with the user. Type: String Management API Reference Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws[a-z\-]*:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+$ Required: Yes clientToken A token that ensures idempotency. This token expires in 10 minutes. Type: String Length Constraints: Minimum length of 1. Maximum length of 36. Pattern: .*\S.* Required: No Response Syntax HTTP/1.1 200 Content-type: application/json { "environmentId": "string", "iamRole": "string", "userArn": "string", "userName": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. UpdateKxUser 258 Management API Reference Amazon FinSpace environmentId A unique identifier for the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ iamRole The IAM role ARN that is associated with the user. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws[a-z\-]*:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+$ userArn The Amazon Resource Name (ARN) that identifies the user. For more information about ARNs and how to use ARNs in policies, see IAM Identifiers in the IAM User Guide. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\d+:kxEnvironment/[0-9A- Za-z_-]{1,128}/kxUser/[0-9A-Za-z_-]{1,128}$ userName A unique identifier for the user. Type: String Length Constraints: Minimum length of 1. Maximum length of 50. Pattern: ^[0-9A-Za-z_-]{1,50}$ Errors For information about the errors that are common to all actions, see Common Errors. UpdateKxUser 259 Amazon FinSpace AccessDeniedException Management API Reference You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 LimitExceededException A service limit or quota is exceeded. HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: UpdateKxUser 260 Amazon FinSpace Management API Reference • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 UpdateKxUser 261 Amazon FinSpace UpdateKxVolume Management API Reference Updates the throughput or capacity of a volume. During the update process, the filesystem might be unavailable for a few minutes. You can retry any operations after the update is complete. Request Syntax PATCH /kx/environments/environmentId/kxvolumes/volumeName HTTP/1.1 Content-type: application/json { "clientToken": "string", "description": "string", "nas1Configuration": { "size": number, "type": "string" } } URI Request Parameters The request uses the following URI parameters. environmentId A unique identifier for the kdb environment where you created the storage volume. Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ Required: Yes volumeName A unique identifier for the volume. Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes UpdateKxVolume 262 Amazon FinSpace Request Body Management API Reference The request accepts the following data in JSON format. clientToken A token that ensures idempotency. This token expires in 10 minutes. Type: String Length Constraints: Minimum length of 1. Maximum length of 64. Pattern: ^[a-zA-Z0-9-]+$ Required: No description A description of the volume. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ Required: No nas1Configuration Specifies the configuration for the Network attached storage (NAS_1) file system volume. Type: KxNAS1Configuration object Required: No Response |
api-reference-047 | api-reference.pdf | 47 | Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes UpdateKxVolume 262 Amazon FinSpace Request Body Management API Reference The request accepts the following data in JSON format. clientToken A token that ensures idempotency. This token expires in 10 minutes. Type: String Length Constraints: Minimum length of 1. Maximum length of 64. Pattern: ^[a-zA-Z0-9-]+$ Required: No description A description of the volume. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ Required: No nas1Configuration Specifies the configuration for the Network attached storage (NAS_1) file system volume. Type: KxNAS1Configuration object Required: No Response Syntax HTTP/1.1 200 Content-type: application/json { "attachedClusters": [ UpdateKxVolume 263 Amazon FinSpace Management API Reference { "clusterName": "string", "clusterStatus": "string", "clusterType": "string" } ], "availabilityZoneIds": [ "string" ], "azMode": "string", "createdTimestamp": number, "description": "string", "environmentId": "string", "lastModifiedTimestamp": number, "nas1Configuration": { "size": number, "type": "string" }, "status": "string", "statusReason": "string", "volumeArn": "string", "volumeName": "string", "volumeType": "string" } Response Elements If the action is successful, the service sends back an HTTP 200 response. The following data is returned in JSON format by the service. attachedClusters Specifies the clusters that a volume is attached to. Type: Array of KxAttachedCluster objects availabilityZoneIds The identifier of the availability zones. Type: Array of strings Length Constraints: Minimum length of 8. Maximum length of 12. Pattern: ^[a-zA-Z0-9-]+$ UpdateKxVolume 264 Amazon FinSpace azMode Management API Reference The number of availability zones you want to assign per volume. Currently, FinSpace only supports SINGLE for volumes. This places dataview in a single AZ. Type: String Valid Values: SINGLE | MULTI createdTimestamp The timestamp at which the volume was created in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp description The description for the volume. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ environmentId A unique identifier for the kdb environment where you want to update the volume. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-z0-9]+$ lastModifiedTimestamp The last time that the volume was updated in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp UpdateKxVolume 265 Amazon FinSpace nas1Configuration Management API Reference Specifies the configuration for the Network attached storage (NAS_1) file system volume. Type: KxNAS1Configuration object status The status of the volume. • CREATING – The volume creation is in progress. • CREATE_FAILED – The volume creation has failed. • ACTIVE – The volume is active. • UPDATING – The volume is in the process of being updated. • UPDATE_FAILED – The update action failed. • UPDATED – The volume is successfully updated. • DELETING – The volume is in the process of being deleted. • DELETE_FAILED – The system failed to delete the volume. • DELETED – The volume is successfully deleted. Type: String Valid Values: CREATING | CREATE_FAILED | ACTIVE | UPDATING | UPDATED | UPDATE_FAILED | DELETING | DELETED | DELETE_FAILED statusReason The error message when a failed state occurs. Type: String Length Constraints: Minimum length of 1. Maximum length of 250. Pattern: ^[a-zA-Z0-9\_\-\.\s]+$ volumeArn The ARN identifier of the volume. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. UpdateKxVolume 266 Amazon FinSpace Management API Reference Pattern: ^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\d+:kxEnvironment/[0-9A- Za-z_-]{1,128}(/kxSharedVolume/[a-zA-Z0-9_-]{1,255})?$ volumeName A unique identifier for the volume that you want to update. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ volumeType The type of file system volume. Currently, FinSpace only supports NAS_1 volume type. Type: String Valid Values: NAS_1 Errors For information about the errors that are common to all actions, see Common Errors. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 403 ConflictException There was a conflict with this action, and it could not be completed. HTTP Status Code: 409 InternalServerException The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 LimitExceededException A service limit or quota is exceeded. UpdateKxVolume 267 Management API Reference Amazon FinSpace HTTP Status Code: 400 ResourceNotFoundException One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS |
api-reference-048 | api-reference.pdf | 48 | One or more resources can't be found. HTTP Status Code: 404 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 429 ValidationException The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS Command Line Interface • AWS SDK for .NET • AWS SDK for C++ • AWS SDK for Go v2 • AWS SDK for Java V2 • AWS SDK for JavaScript V3 • AWS SDK for Kotlin • AWS SDK for PHP V3 • AWS SDK for Python • AWS SDK for Ruby V3 Data Types The following data types are supported: Data Types 268 Amazon FinSpace • AutoScalingConfiguration • CapacityConfiguration • ChangeRequest • CodeConfiguration • CustomDNSServer • Environment • ErrorInfo • FederationParameters • IcmpTypeCode • KxAttachedCluster • KxCacheStorageConfiguration • KxChangesetListEntry • KxCluster • KxClusterCodeDeploymentConfiguration • KxCommandLineArgument • KxDatabaseCacheConfiguration • KxDatabaseConfiguration • KxDatabaseListEntry • KxDataviewActiveVersion • KxDataviewConfiguration • KxDataviewListEntry • KxDataviewSegmentConfiguration • KxDeploymentConfiguration • KxEnvironment • KxNAS1Configuration • KxNode • KxSavedownStorageConfiguration • KxScalingGroup • KxScalingGroupConfiguration • KxUser Data Types Management API Reference 269 Management API Reference Amazon FinSpace • KxVolume • NetworkACLEntry • PortRange • SuperuserParameters • TickerplantLogConfiguration • TransitGatewayConfiguration • Volume • VpcConfiguration Data Types 270 Amazon FinSpace Management API Reference AutoScalingConfiguration The configuration based on which FinSpace will scale in or scale out nodes in your cluster. Contents Note In the following list, the required parameters are described first. autoScalingMetric The metric your cluster will track in order to scale in and out. For example, CPU_UTILIZATION_PERCENTAGE is the average CPU usage across all the nodes in a cluster. Type: String Valid Values: CPU_UTILIZATION_PERCENTAGE Required: No maxNodeCount The highest number of nodes to scale. This value cannot be greater than 5. Type: Integer Valid Range: Minimum value of 1. Required: No metricTarget The desired value of the chosen autoScalingMetric. When the metric drops below this value, the cluster will scale in. When the metric goes above this value, the cluster will scale out. You can set the target value between 1 and 100 percent. Type: Double Valid Range: Minimum value of 1. Maximum value of 100. Required: No AutoScalingConfiguration 271 Amazon FinSpace minNodeCount Management API Reference The lowest number of nodes to scale. This value must be at least 1 and less than the maxNodeCount. If the nodes in a cluster belong to multiple availability zones, then minNodeCount must be at least 3. Type: Integer Valid Range: Minimum value of 1. Required: No scaleInCooldownSeconds The duration in seconds that FinSpace will wait after a scale in event before initiating another scaling event. Type: Double Valid Range: Minimum value of 0. Maximum value of 100000. Required: No scaleOutCooldownSeconds The duration in seconds that FinSpace will wait after a scale out event before initiating another scaling event. Type: Double Valid Range: Minimum value of 0. Maximum value of 100000. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 AutoScalingConfiguration 272 Amazon FinSpace Management API Reference AutoScalingConfiguration 273 Amazon FinSpace Management API Reference CapacityConfiguration A structure for the metadata of a cluster. It includes information like the CPUs needed, memory of instances, and number of instances. Contents Note In the following list, the required parameters are described first. nodeCount The number of instances running in a cluster. Type: Integer Valid Range: Minimum value of 1. Required: No nodeType The type that determines the hardware of the host computer used for your cluster instance. Each node type offers different memory and storage capabilities. Choose a node type based on the requirements of the application or software that you plan to run on your instance. You can only specify one of the following values: • kx.s.large – The node type with a configuration of 12 GiB memory and 2 vCPUs. • kx.s.xlarge – The node type with a configuration of 27 GiB memory and 4 vCPUs. • kx.s.2xlarge – The node type with a configuration of 54 GiB memory and 8 vCPUs. • kx.s.4xlarge – The node type with a configuration of 108 GiB memory and 16 vCPUs. • kx.s.8xlarge – The node type with a configuration of 216 GiB memory and 32 vCPUs. • kx.s.16xlarge – The node type with a configuration of 432 GiB memory and 64 vCPUs. • kx.s.32xlarge – The node type with a configuration of 864 GiB memory and 128 vCPUs. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. CapacityConfiguration 274 Amazon FinSpace Management API Reference Pattern: ^[a-zA-Z0-9._]+$ Required: No See Also For more information about using this API in one of the language-specific AWS |
api-reference-049 | api-reference.pdf | 49 | – The node type with a configuration of 108 GiB memory and 16 vCPUs. • kx.s.8xlarge – The node type with a configuration of 216 GiB memory and 32 vCPUs. • kx.s.16xlarge – The node type with a configuration of 432 GiB memory and 64 vCPUs. • kx.s.32xlarge – The node type with a configuration of 864 GiB memory and 128 vCPUs. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. CapacityConfiguration 274 Amazon FinSpace Management API Reference Pattern: ^[a-zA-Z0-9._]+$ Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 CapacityConfiguration 275 Amazon FinSpace ChangeRequest A list of change request objects. Contents Note Management API Reference In the following list, the required parameters are described first. changeType Defines the type of change request. A changeType can have the following values: • PUT – Adds or updates files in a database. • DELETE – Deletes files in a database. Type: String Valid Values: PUT | DELETE Required: Yes dbPath Defines the path within the database directory. Type: String Length Constraints: Minimum length of 1. Maximum length of 1025. Pattern: ^(\*)*[\/\?\*]([^\/]+\/){0,2}[^\/]*$ Required: Yes s3Path Defines the S3 path of the source file that is required to add or update files in a database. Type: String Length Constraints: Minimum length of 9. Maximum length of 1093. ChangeRequest 276 Amazon FinSpace Management API Reference Pattern: ^s3:\/\/[a-z0-9][a-z0-9-.]{1,61}[a-z0-9]\/([^\/]+\/)*[^\/]*$ Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 ChangeRequest 277 Amazon FinSpace CodeConfiguration Management API Reference The structure of the customer code available within the running cluster. Contents Note In the following list, the required parameters are described first. s3Bucket A unique name for the S3 bucket. Type: String Length Constraints: Minimum length of 3. Maximum length of 255. Pattern: ^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$ Required: No s3Key The full S3 path (excluding bucket) to the .zip file. This file contains the code that is loaded onto the cluster when it's started. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Pattern: ^[a-zA-Z0-9\/\!\-_\.\*'\(\)]+$ Required: No s3ObjectVersion The version of an S3 object. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. CodeConfiguration 278 Amazon FinSpace Required: No See Also Management API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 CodeConfiguration 279 Amazon FinSpace CustomDNSServer Management API Reference A list of DNS server name and server IP. This is used to set up Route-53 outbound resolvers. Contents Note In the following list, the required parameters are described first. customDNSServerIP The IP address of the DNS server. Type: String Pattern: ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]| 2[0-4][0-9]|[01]?[0-9][0-9]?)$ Required: Yes customDNSServerName The name of the DNS server. Type: String Length Constraints: Minimum length of 3. Maximum length of 255. Pattern: ^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA- Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$ Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ CustomDNSServer 280 Amazon FinSpace • AWS SDK for Java V2 • AWS SDK for Ruby V3 Management API Reference CustomDNSServer 281 Amazon FinSpace Environment Represents an FinSpace environment. Contents Note Management API Reference In the following list, the required parameters are described first. awsAccountId The ID of the AWS account in which the FinSpace environment is created. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: No dedicatedServiceAccountId The AWS account ID of the dedicated service account associated with your FinSpace environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: No description The description of the FinSpace environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Environment 282 Amazon FinSpace Management API Reference Pattern: ^[a-zA-Z0-9. ]{1,1000}$ Required: No environmentArn The Amazon Resource Name (ARN) of your FinSpace environment. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\d+:environment/[0-9A-Za- z_-]{1,128}$ Required: No environmentId The identifier of the FinSpace environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: No environmentUrl The sign-in URL for the web application of your FinSpace environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^https?://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|] Required: No federationMode The authentication mode for the environment. Type: String Environment 283 Amazon FinSpace Management API Reference Valid Values: FEDERATED | LOCAL Required: No federationParameters Configuration information when authentication mode is FEDERATED. Type: FederationParameters object Required: |
api-reference-050 | api-reference.pdf | 50 | Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\d+:environment/[0-9A-Za- z_-]{1,128}$ Required: No environmentId The identifier of the FinSpace environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: No environmentUrl The sign-in URL for the web application of your FinSpace environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^https?://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|] Required: No federationMode The authentication mode for the environment. Type: String Environment 283 Amazon FinSpace Management API Reference Valid Values: FEDERATED | LOCAL Required: No federationParameters Configuration information when authentication mode is FEDERATED. Type: FederationParameters object Required: No kmsKeyId The KMS key id used to encrypt in the FinSpace environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z-0-9-:\/]*$ Required: No name The name of the FinSpace environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]$ Required: No sageMakerStudioDomainUrl The URL of the integrated FinSpace notebook environment in your web application. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z-0-9-:\/.]*$ Required: No Environment 284 Amazon FinSpace status Management API Reference The current status of creation of the FinSpace environment. Type: String Valid Values: CREATE_REQUESTED | CREATING | CREATED | DELETE_REQUESTED | DELETING | DELETED | FAILED_CREATION | RETRY_DELETION | FAILED_DELETION | UPDATE_NETWORK_REQUESTED | UPDATING_NETWORK | FAILED_UPDATING_NETWORK | SUSPENDED Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 Environment 285 Amazon FinSpace ErrorInfo Management API Reference Provides details in the event of a failed flow, including the error type and the related error message. Contents Note In the following list, the required parameters are described first. errorMessage Specifies the error message that appears if a flow fails. Type: String Length Constraints: Maximum length of 1000. Required: No errorType Specifies the type of error. Type: String Valid Values: The inputs to this request are invalid. | Service limits have been exceeded. | Missing required permission to perform this request. | One or more inputs to this request were not found. | The system temporarily lacks sufficient resources to process the request. | An internal error has occurred. | Cancelled | A user recoverable error has occurred Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: ErrorInfo 286 Amazon FinSpace • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 Management API Reference ErrorInfo 287 Amazon FinSpace Management API Reference FederationParameters Configuration information when authentication mode is FEDERATED. Contents Note In the following list, the required parameters are described first. applicationCallBackURL The redirect or sign-in URL that should be entered into the SAML 2.0 compliant identity provider configuration (IdP). Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^https?://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|] Required: No attributeMap SAML attribute name and value. The name must always be Email and the value should be set to the attribute definition in which user email is set. For example, name would be Email and value http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress. Please check your SAML 2.0 compliant identity provider (IdP) documentation for details. Type: String to string map Key Length Constraints: Minimum length of 1. Maximum length of 32. Key Pattern: .* Value Length Constraints: Minimum length of 1. Maximum length of 1000. Value Pattern: .* Required: No FederationParameters 288 Amazon FinSpace federationProviderName Name of the identity provider (IdP). Type: String Management API Reference Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: [^_\p{Z}][\p{L}\p{M}\p{S}\p{N}\p{P}][^_\p{Z}]+ Required: No federationURN The Uniform Resource Name (URN). Also referred as Service Provider URN or Audience URI or Service Provider Entity ID. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: ^[A-Za-z0-9._\-:\/#\+]+$ Required: No samlMetadataDocument SAML 2.0 Metadata document from identity provider (IdP). Type: String Length Constraints: Minimum length of 1000. Maximum length of 10000000. Pattern: .* Required: No samlMetadataURL Provide the metadata URL from your SAML 2.0 compliant identity provider (IdP). Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^https?://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|] FederationParameters 289 Amazon FinSpace Required: No See Also Management API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 FederationParameters 290 Amazon FinSpace IcmpTypeCode Management API Reference Defines the ICMP protocol that consists of the ICMP type and code. Contents Note In the following list, the required parameters are described first. code The ICMP code. A value of -1 means all codes for the specified ICMP type. Type: Integer Required: Yes type The |
api-reference-051 | api-reference.pdf | 51 | ^https?://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|] FederationParameters 289 Amazon FinSpace Required: No See Also Management API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 FederationParameters 290 Amazon FinSpace IcmpTypeCode Management API Reference Defines the ICMP protocol that consists of the ICMP type and code. Contents Note In the following list, the required parameters are described first. code The ICMP code. A value of -1 means all codes for the specified ICMP type. Type: Integer Required: Yes type The ICMP type. A value of -1 means all types. Type: Integer Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 IcmpTypeCode 291 Amazon FinSpace KxAttachedCluster The structure containing the metadata of the attached clusters. Management API Reference Contents Note In the following list, the required parameters are described first. clusterName A unique name for the attached cluster. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: No clusterStatus The status of the attached cluster. • PENDING – The cluster is pending creation. • CREATING – The cluster creation process is in progress. • CREATE_FAILED – The cluster creation process has failed. • RUNNING – The cluster creation process is running. • UPDATING – The cluster is in the process of being updated. • DELETING – The cluster is in the process of being deleted. • DELETED – The cluster has been deleted. • DELETE_FAILED – The cluster failed to delete. Type: String Valid Values: PENDING | CREATING | CREATE_FAILED | RUNNING | UPDATING | DELETING | DELETED | DELETE_FAILED KxAttachedCluster 292 Amazon FinSpace Required: No clusterType Management API Reference Specifies the type of cluster. The volume for TP and RDB cluster types will be used for TP logs. Type: String Valid Values: HDB | RDB | GATEWAY | GP | TICKERPLANT Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 KxAttachedCluster 293 Amazon FinSpace Management API Reference KxCacheStorageConfiguration The configuration for read only disk cache associated with a cluster. Contents Note In the following list, the required parameters are described first. size The size of cache in Gigabytes. Type: Integer Required: Yes type The type of cache storage. The valid values are: • CACHE_1000 – This type provides at least 1000 MB/s disk access throughput. • CACHE_250 – This type provides at least 250 MB/s disk access throughput. • CACHE_12 – This type provides at least 12 MB/s disk access throughput. For cache type CACHE_1000 and CACHE_250 you can select cache size as 1200 GB or increments of 2400 GB. For cache type CACHE_12 you can select the cache size in increments of 6000 GB. Type: String Length Constraints: Minimum length of 8. Maximum length of 10. Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: KxCacheStorageConfiguration 294 Amazon FinSpace • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 Management API Reference KxCacheStorageConfiguration 295 Amazon FinSpace Management API Reference KxChangesetListEntry Details of changeset. Contents Note In the following list, the required parameters are described first. activeFromTimestamp Beginning time from which the changeset is active. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Required: No changesetId A unique identifier for the changeset. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]+$ Required: No createdTimestamp The timestamp at which the changeset was created in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Required: No KxChangesetListEntry 296 Amazon FinSpace lastModifiedTimestamp Management API Reference The timestamp at which the changeset was modified. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Required: No status Status of the changeset. • Pending – Changeset creation is pending. • Processing – Changeset creation is running. • Failed – Changeset creation has failed. • Complete – Changeset creation has succeeded. Type: String Valid Values: PENDING | PROCESSING | FAILED | COMPLETED Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: |
api-reference-052 | api-reference.pdf | 52 | at which the changeset was modified. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Required: No status Status of the changeset. • Pending – Changeset creation is pending. • Processing – Changeset creation is running. • Failed – Changeset creation has failed. • Complete – Changeset creation has succeeded. Type: String Valid Values: PENDING | PROCESSING | FAILED | COMPLETED Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 KxChangesetListEntry 297 Management API Reference Amazon FinSpace KxCluster The details of a kdb cluster. Contents Note In the following list, the required parameters are described first. availabilityZoneId The availability zone identifiers for the requested regions. Type: String Length Constraints: Minimum length of 8. Maximum length of 12. Pattern: ^[a-zA-Z0-9-]+$ Required: No azMode The number of availability zones assigned per cluster. This can be one of the following: • SINGLE – Assigns one availability zone per cluster. • MULTI – Assigns all the availability zones per cluster. Type: String Valid Values: SINGLE | MULTI Required: No clusterDescription A description of the cluster. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. KxCluster 298 Amazon FinSpace Management API Reference Pattern: ^[a-zA-Z0-9\_\-\.\s]+$ Required: No clusterName A unique name for the cluster. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: No clusterType Specifies the type of KDB database that is being created. The following types are available: • HDB – A Historical Database. The data is only accessible with read-only permissions from one of the FinSpace managed kdb databases mounted to the cluster. • RDB – A Realtime Database. This type of database captures all the data from a ticker plant and stores it in memory until the end of day, after which it writes all of its data to a disk and reloads the HDB. This cluster type requires local storage for temporary storage of data during the savedown process. If you specify this field in your request, you must provide the savedownStorageConfiguration parameter. • GATEWAY – A gateway cluster allows you to access data across processes in kdb systems. It allows you to create your own routing logic using the initialization scripts and custom code. This type of cluster does not require a writable local storage. • GP – A general purpose cluster allows you to quickly iterate on code during development by granting greater access to system commands and enabling a fast reload of custom code. This cluster type can optionally mount databases including cache and savedown storage. For this cluster type, the node count is fixed at 1. It does not support autoscaling and supports only SINGLE AZ mode. • Tickerplant – A tickerplant cluster allows you to subscribe to feed handlers based on IAM permissions. It can publish to RDBs, other Tickerplants, and real-time subscribers (RTS). Tickerplants can persist messages to log, which is readable by any RDB environment. It supports only single-node that is only one kdb process. Type: String KxCluster 299 Amazon FinSpace Management API Reference Valid Values: HDB | RDB | GATEWAY | GP | TICKERPLANT Required: No createdTimestamp The timestamp at which the cluster was created in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Required: No executionRole An IAM role that defines a set of permissions associated with a cluster. These permissions are assumed when a cluster attempts to access another cluster. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Pattern: ^arn:aws[a-z0-9-]*:iam::\d{12}:role\/[\w-\/.@+=,]{1,1017}$ Required: No initializationScript Specifies a Q program that will be run at launch of a cluster. It is a relative path within .zip file that contains the custom code, which will be loaded on the cluster. It must include the file name itself. For example, somedir/init.q. Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Pattern: ^[a-zA-Z0-9\_\-\.\/\\]+$ Required: No lastModifiedTimestamp The last time that the cluster was modified. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. KxCluster 300 Management API Reference Amazon FinSpace Type: Timestamp Required: No releaseLabel A version of the FinSpace managed kdb to run. Type: String Length Constraints: Minimum length of 1. Maximum length of 16. Pattern: ^[a-zA-Z0-9._-]+$ Required: No status The status of a cluster. • PENDING – The cluster is pending creation. • CREATING –The cluster creation process is in progress. • CREATE_FAILED– The cluster creation |
api-reference-053 | api-reference.pdf | 53 | No lastModifiedTimestamp The last time that the cluster was modified. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. KxCluster 300 Management API Reference Amazon FinSpace Type: Timestamp Required: No releaseLabel A version of the FinSpace managed kdb to run. Type: String Length Constraints: Minimum length of 1. Maximum length of 16. Pattern: ^[a-zA-Z0-9._-]+$ Required: No status The status of a cluster. • PENDING – The cluster is pending creation. • CREATING –The cluster creation process is in progress. • CREATE_FAILED– The cluster creation process has failed. • RUNNING – The cluster creation process is running. • UPDATING – The cluster is in the process of being updated. • DELETING – The cluster is in the process of being deleted. • DELETED – The cluster has been deleted. • DELETE_FAILED – The cluster failed to delete. Type: String Valid Values: PENDING | CREATING | CREATE_FAILED | RUNNING | UPDATING | DELETING | DELETED | DELETE_FAILED Required: No statusReason The error message when a failed state occurs. Type: String Length Constraints: Minimum length of 1. Maximum length of 250. KxCluster 301 Amazon FinSpace Management API Reference Pattern: ^[a-zA-Z0-9\_\-\.\s]+$ Required: No volumes A list of volumes attached to the cluster. Type: Array of Volume objects Array Members: Minimum number of 0 items. Maximum number of 5 items. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 KxCluster 302 Amazon FinSpace Management API Reference KxClusterCodeDeploymentConfiguration The configuration that allows you to choose how you want to update code on a cluster. Depending on the option you choose, you can reduce the time it takes to update the cluster. Contents Note In the following list, the required parameters are described first. deploymentStrategy The type of deployment that you want on a cluster. • ROLLING – This options updates the cluster by stopping the exiting q process and starting a new q process with updated configuration. • NO_RESTART – This option updates the cluster without stopping the running q process. It is only available for GP type cluster. This option is quicker as it reduces the turn around time to update configuration on a cluster. With this deployment mode, you cannot update the initializationScript and commandLineArguments parameters. • FORCE – This option updates the cluster by immediately stopping all the running processes before starting up new ones with the updated configuration. Type: String Valid Values: NO_RESTART | ROLLING | FORCE Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ KxClusterCodeDeploymentConfiguration 303 Amazon FinSpace • AWS SDK for Java V2 • AWS SDK for Ruby V3 Management API Reference KxClusterCodeDeploymentConfiguration 304 Amazon FinSpace Management API Reference KxCommandLineArgument Defines the key-value pairs to make them available inside the cluster. Duplicate keys are not allowed. To send a list of values for the same command line argument (key), use a space delimited list of values for the key. Contents Note In the following list, the required parameters are described first. key The name of the key. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Pattern: ^(?![Aa][Ww][Ss])(s|([a-zA-Z][a-zA-Z0-9_]+))|(AWS_ZIP_DEFAULT) Required: No value The value of the key. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Pattern: ^[a-zA-Z0-9_:./,; ]+$ Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: KxCommandLineArgument 305 Amazon FinSpace • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 Management API Reference KxCommandLineArgument 306 Amazon FinSpace Management API Reference KxDatabaseCacheConfiguration The structure of database cache configuration that is used for mapping database paths to cache types in clusters. Contents Note In the following list, the required parameters are described first. cacheType The type of disk cache. This parameter is used to map the database path to cache storage. The valid values are: • CACHE_1000 – This type provides at least 1000 MB/s disk access throughput. Type: String Length Constraints: Minimum length of 8. Maximum length of 10. Required: Yes dbPaths Specifies the portions of database that will be loaded into the cache for access. Type: Array of strings Length Constraints: Minimum length of 1. Maximum length of 1025. Pattern: ^(\*)*[\/\?\*]([^\/]+\/){0,2}[^\/]*$ Required: Yes dataviewName The name of the dataview to be used for caching historical data on disk. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. KxDatabaseCacheConfiguration 307 Amazon FinSpace Management API Reference Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: No See Also For more information about using this API in |
api-reference-054 | api-reference.pdf | 54 | 1000 MB/s disk access throughput. Type: String Length Constraints: Minimum length of 8. Maximum length of 10. Required: Yes dbPaths Specifies the portions of database that will be loaded into the cache for access. Type: Array of strings Length Constraints: Minimum length of 1. Maximum length of 1025. Pattern: ^(\*)*[\/\?\*]([^\/]+\/){0,2}[^\/]*$ Required: Yes dataviewName The name of the dataview to be used for caching historical data on disk. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. KxDatabaseCacheConfiguration 307 Amazon FinSpace Management API Reference Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 KxDatabaseCacheConfiguration 308 Amazon FinSpace Management API Reference KxDatabaseConfiguration The configuration of data that is available for querying from this database. Contents Note In the following list, the required parameters are described first. databaseName The name of the kdb database. When this parameter is specified in the structure, S3 with the whole database is included by default. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes cacheConfigurations Configuration details for the disk cache used to increase performance reading from a kdb database mounted to the cluster. Type: Array of KxDatabaseCacheConfiguration objects Required: No changesetId A unique identifier of the changeset that is associated with the cluster. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]+$ Required: No KxDatabaseConfiguration 309 Amazon FinSpace dataviewConfiguration Management API Reference The configuration of the dataview to be used with specified cluster. Type: KxDataviewConfiguration object Required: No dataviewName The name of the dataview to be used for caching historical data on disk. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 KxDatabaseConfiguration 310 Amazon FinSpace Management API Reference KxDatabaseListEntry Details about a FinSpace managed kdb database Contents Note In the following list, the required parameters are described first. createdTimestamp The timestamp at which the database was created in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Required: No databaseName The name of the kdb database. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: No lastModifiedTimestamp The last time that the database was modified. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Required: No KxDatabaseListEntry 311 Amazon FinSpace See Also Management API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 KxDatabaseListEntry 312 Amazon FinSpace Management API Reference KxDataviewActiveVersion The active version of the dataview that is currently in use by this cluster. Contents Note In the following list, the required parameters are described first. attachedClusters The list of clusters that are currently using this dataview. Type: Array of strings Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: No changesetId A unique identifier for the changeset. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]+$ Required: No createdTimestamp The timestamp at which the dataview version was active. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Required: No KxDataviewActiveVersion 313 Amazon FinSpace segmentConfigurations Management API Reference The configuration that contains the database path of the data that you want to place on each selected volume. Each segment must have a unique database path for each volume. If you do not explicitly specify any database path for a volume, they are accessible from the cluster through the default S3/object store segment. Type: Array of KxDataviewSegmentConfiguration objects Array Members: Minimum number of 0 items. Maximum number of 50 items. Required: No versionId A unique identifier of the active version. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 KxDataviewActiveVersion 314 Amazon FinSpace Management API Reference KxDataviewConfiguration The structure that stores the configuration details of a dataview. Contents Note |
api-reference-055 | api-reference.pdf | 55 | S3/object store segment. Type: Array of KxDataviewSegmentConfiguration objects Array Members: Minimum number of 0 items. Maximum number of 50 items. Required: No versionId A unique identifier of the active version. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 KxDataviewActiveVersion 314 Amazon FinSpace Management API Reference KxDataviewConfiguration The structure that stores the configuration details of a dataview. Contents Note In the following list, the required parameters are described first. changesetId A unique identifier for the changeset. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]+$ Required: No dataviewName The unique identifier of the dataview. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: No dataviewVersionId The version of the dataview corresponding to a given changeset. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Required: No KxDataviewConfiguration 315 Amazon FinSpace segmentConfigurations Management API Reference The db path and volume configuration for the segmented database. Type: Array of KxDataviewSegmentConfiguration objects Array Members: Minimum number of 0 items. Maximum number of 50 items. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 KxDataviewConfiguration 316 Amazon FinSpace Management API Reference KxDataviewListEntry A collection of kdb dataview entries. Contents Note In the following list, the required parameters are described first. activeVersions The active changeset versions for the given dataview entry. Type: Array of KxDataviewActiveVersion objects Required: No autoUpdate The option to specify whether you want to apply all the future additions and corrections automatically to the dataview when you ingest new changesets. The default value is false. Type: Boolean Required: No availabilityZoneId The identifier of the availability zones. Type: String Length Constraints: Minimum length of 8. Maximum length of 12. Pattern: ^[a-zA-Z0-9-]+$ Required: No azMode The number of availability zones you want to assign per volume. Currently, FinSpace only supports SINGLE for volumes. This places dataview in a single AZ. KxDataviewListEntry 317 Management API Reference Amazon FinSpace Type: String Valid Values: SINGLE | MULTI Required: No changesetId A unique identifier for the changeset. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]+$ Required: No createdTimestamp The timestamp at which the dataview list entry was created in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Required: No databaseName A unique identifier of the database. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: No dataviewName A unique identifier of the dataview. Type: String KxDataviewListEntry 318 Amazon FinSpace Management API Reference Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: No description A description for the dataview list entry. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ Required: No environmentId A unique identifier for the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: .*\S.* Required: No lastModifiedTimestamp The last time that the dataview list was updated in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Required: No readWrite Returns True if the dataview is created as writeable and False otherwise. Type: Boolean KxDataviewListEntry 319 Amazon FinSpace Required: No segmentConfigurations Management API Reference The configuration that contains the database path of the data that you want to place on each selected volume. Each segment must have a unique database path for each volume. If you do not explicitly specify any database path for a volume, they are accessible from the cluster through the default S3/object store segment. Type: Array of KxDataviewSegmentConfiguration objects Array Members: Minimum number of 0 items. Maximum number of 50 items. Required: No status The status of a given dataview entry. Type: String Valid Values: CREATING | ACTIVE | UPDATING | FAILED | DELETING Required: No statusReason The error message when a failed state occurs. Type: String Length Constraints: Minimum length of 1. Maximum length of 250. Pattern: ^[a-zA-Z0-9\_\-\.\s]+$ Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 KxDataviewListEntry 320 Amazon FinSpace • AWS SDK for Ruby V3 Management API Reference KxDataviewListEntry 321 Amazon FinSpace Management API Reference |
api-reference-056 | api-reference.pdf | 56 | Required: No status The status of a given dataview entry. Type: String Valid Values: CREATING | ACTIVE | UPDATING | FAILED | DELETING Required: No statusReason The error message when a failed state occurs. Type: String Length Constraints: Minimum length of 1. Maximum length of 250. Pattern: ^[a-zA-Z0-9\_\-\.\s]+$ Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 KxDataviewListEntry 320 Amazon FinSpace • AWS SDK for Ruby V3 Management API Reference KxDataviewListEntry 321 Amazon FinSpace Management API Reference KxDataviewSegmentConfiguration The configuration that contains the database path of the data that you want to place on each selected volume. Each segment must have a unique database path for each volume. If you do not explicitly specify any database path for a volume, they are accessible from the cluster through the default S3/object store segment. Contents Note In the following list, the required parameters are described first. dbPaths The database path of the data that you want to place on each selected volume for the segment. Each segment must have a unique database path for each volume. Type: Array of strings Array Members: Minimum number of 1 item. Maximum number of 30 items. Length Constraints: Minimum length of 1. Maximum length of 1025. Pattern: ^(\*)*[\/\?\*]([^\/]+\/){0,2}[^\/]*$ Required: Yes volumeName The name of the volume where you want to add data. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes KxDataviewSegmentConfiguration 322 Amazon FinSpace onDemand Management API Reference Enables on-demand caching on the selected database path when a particular file or a column of the database is accessed. When on demand caching is True, dataviews perform minimal loading of files on the filesystem as needed. When it is set to False, everything is cached. The default value is False. Type: Boolean Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 KxDataviewSegmentConfiguration 323 Amazon FinSpace Management API Reference KxDeploymentConfiguration The configuration that allows you to choose how you want to update the databases on a cluster. Depending on the option you choose, you can reduce the time it takes to update the cluster. Contents Note In the following list, the required parameters are described first. deploymentStrategy The type of deployment that you want on a cluster. • ROLLING – This options updates the cluster by stopping the exiting q process and starting a new q process with updated configuration. • NO_RESTART – This option updates the cluster without stopping the running q process. It is only available for HDB type cluster. This option is quicker as it reduces the turn around time to update configuration on a cluster. With this deployment mode, you cannot update the initializationScript and commandLineArguments parameters. Type: String Valid Values: NO_RESTART | ROLLING Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 KxDeploymentConfiguration 324 Amazon FinSpace Management API Reference KxDeploymentConfiguration 325 Amazon FinSpace KxEnvironment The details of a kdb environment. Contents Note Management API Reference In the following list, the required parameters are described first. availabilityZoneIds The identifier of the availability zones where subnets for the environment are created. Type: Array of strings Length Constraints: Minimum length of 8. Maximum length of 12. Pattern: ^[a-zA-Z0-9-]+$ Required: No awsAccountId The unique identifier of the AWS account in which you create the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: No certificateAuthorityArn The Amazon Resource Name (ARN) of the certificate authority: Type: String Length Constraints: Minimum length of 1. Maximum length of 255. Required: No KxEnvironment 326 Amazon FinSpace creationTimestamp Management API Reference The timestamp at which the kdb environment was created in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Required: No customDNSConfiguration A list of DNS server name and server IP. This is used to set up Route-53 outbound resolvers. Type: Array of CustomDNSServer objects Required: No dedicatedServiceAccountId A unique identifier for the AWS environment infrastructure account. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: No description A description of the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ Required: No dnsStatus The status of DNS configuration. Type: String KxEnvironment 327 Amazon FinSpace Management API Reference Valid Values: NONE |
api-reference-057 | api-reference.pdf | 57 | as 1635768000000. Type: Timestamp Required: No customDNSConfiguration A list of DNS server name and server IP. This is used to set up Route-53 outbound resolvers. Type: Array of CustomDNSServer objects Required: No dedicatedServiceAccountId A unique identifier for the AWS environment infrastructure account. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: No description A description of the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ Required: No dnsStatus The status of DNS configuration. Type: String KxEnvironment 327 Amazon FinSpace Management API Reference Valid Values: NONE | UPDATE_REQUESTED | UPDATING | FAILED_UPDATE | SUCCESSFULLY_UPDATED Required: No environmentArn The Amazon Resource Name (ARN) of your kdb environment. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\d+:environment/[0-9A-Za- z_-]{1,128}$ Required: No environmentId A unique identifier for the kdb environment. Type: String Length Constraints: Minimum length of 1. Maximum length of 26. Pattern: ^[a-zA-Z0-9]{1,26}$ Required: No errorMessage Specifies the error message that appears if a flow fails. Type: String Length Constraints: Minimum length of 0. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ Required: No kmsKeyId The unique identifier of the KMS key. KxEnvironment 328 Amazon FinSpace Type: String Management API Reference Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z-0-9-:\/]*$ Required: No name The name of the kdb environment. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: No status The status of the environment creation. • CREATE_REQUESTED – Environment creation has been requested. • CREATING – Environment is in the process of being created. • FAILED_CREATION – Environment creation has failed. • CREATED – Environment is successfully created and is currently active. • DELETE REQUESTED – Environment deletion has been requested. • DELETING – Environment is in the process of being deleted. • RETRY_DELETION – Initial environment deletion failed, system is reattempting delete. • DELETED – Environment has been deleted. • FAILED_DELETION – Environment deletion has failed. Type: String Valid Values: CREATE_REQUESTED | CREATING | CREATED | DELETE_REQUESTED | DELETING | DELETED | FAILED_CREATION | RETRY_DELETION | FAILED_DELETION | UPDATE_NETWORK_REQUESTED | UPDATING_NETWORK | FAILED_UPDATING_NETWORK | SUSPENDED Required: No KxEnvironment 329 Amazon FinSpace tgwStatus The status of the network configuration. Type: String Management API Reference Valid Values: NONE | UPDATE_REQUESTED | UPDATING | FAILED_UPDATE | SUCCESSFULLY_UPDATED Required: No transitGatewayConfiguration Specifies the transit gateway and network configuration to connect the kdb environment to an internal network. Type: TransitGatewayConfiguration object Required: No updateTimestamp The timestamp at which the kdb environment was modified in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 KxEnvironment 330 Amazon FinSpace Management API Reference KxNAS1Configuration The structure containing the size and type of the network attached storage (NAS_1) file system volume. Contents Note In the following list, the required parameters are described first. size The size of the network attached storage. For storage type SSD_1000 and SSD_250 you can select the minimum size as 1200 GB or increments of 2400 GB. For storage type HDD_12 you can select the minimum size as 6000 GB or increments of 6000 GB. Type: Integer Valid Range: Minimum value of 1200. Required: No type The type of the network attached storage. Type: String Valid Values: SSD_1000 | SSD_250 | HDD_12 Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 KxNAS1Configuration 331 Amazon FinSpace • AWS SDK for Ruby V3 Management API Reference KxNAS1Configuration 332 Management API Reference Amazon FinSpace KxNode A structure that stores metadata for a kdb node. Contents Note In the following list, the required parameters are described first. availabilityZoneId The identifier of the availability zones where subnets for the environment are created. Type: String Length Constraints: Minimum length of 8. Maximum length of 12. Pattern: ^[a-zA-Z0-9-]+$ Required: No launchTime The time when a particular node is started. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Required: No nodeId A unique identifier for the node. Type: String Length Constraints: Minimum length of 1. Maximum length of 40. Required: No KxNode 333 Management API Reference Amazon FinSpace status Specifies the status of the cluster nodes. • RUNNING – The node is actively serving. • PROVISIONING – The node is being prepared. Type: String Valid Values: RUNNING | |
api-reference-058 | api-reference.pdf | 58 | Pattern: ^[a-zA-Z0-9-]+$ Required: No launchTime The time when a particular node is started. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Required: No nodeId A unique identifier for the node. Type: String Length Constraints: Minimum length of 1. Maximum length of 40. Required: No KxNode 333 Management API Reference Amazon FinSpace status Specifies the status of the cluster nodes. • RUNNING – The node is actively serving. • PROVISIONING – The node is being prepared. Type: String Valid Values: RUNNING | PROVISIONING Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 KxNode 334 Amazon FinSpace Management API Reference KxSavedownStorageConfiguration The size and type of temporary storage that is used to hold data during the savedown process. All the data written to this storage space is lost when the cluster node is restarted. Contents Note In the following list, the required parameters are described first. size The size of temporary storage in gibibytes. Type: Integer Valid Range: Minimum value of 10. Maximum value of 16000. Required: No type The type of writeable storage space for temporarily storing your savedown data. The valid values are: • SDS01 – This type represents 3000 IOPS and io2 ebs volume type. Type: String Valid Values: SDS01 Required: No volumeName The name of the kdb volume that you want to use as writeable save-down storage for clusters. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ KxSavedownStorageConfiguration 335 Amazon FinSpace Required: No See Also Management API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 KxSavedownStorageConfiguration 336 Management API Reference Amazon FinSpace KxScalingGroup A structure for storing metadata of scaling group. Contents Note In the following list, the required parameters are described first. availabilityZoneId The identifier of the availability zones. Type: String Length Constraints: Minimum length of 8. Maximum length of 12. Pattern: ^[a-zA-Z0-9-]+$ Required: No clusters The list of clusters currently active in a given scaling group. Type: Array of strings Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: No createdTimestamp The timestamp at which the scaling group was created in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Required: No KxScalingGroup 337 Amazon FinSpace hostType Management API Reference The memory and CPU capabilities of the scaling group host on which FinSpace Managed kdb clusters will be placed. You can add one of the following values: • kx.sg.large – The host type with a configuration of 16 GiB memory and 2 vCPUs. • kx.sg.xlarge – The host type with a configuration of 32 GiB memory and 4 vCPUs. • kx.sg.2xlarge – The host type with a configuration of 64 GiB memory and 8 vCPUs. • kx.sg.4xlarge – The host type with a configuration of 108 GiB memory and 16 vCPUs. • kx.sg.8xlarge – The host type with a configuration of 216 GiB memory and 32 vCPUs. • kx.sg.16xlarge – The host type with a configuration of 432 GiB memory and 64 vCPUs. • kx.sg.32xlarge – The host type with a configuration of 864 GiB memory and 128 vCPUs. • kx.sg1.16xlarge – The host type with a configuration of 1949 GiB memory and 64 vCPUs. • kx.sg1.24xlarge – The host type with a configuration of 2948 GiB memory and 96 vCPUs. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. Pattern: ^[a-zA-Z0-9._]+ Required: No lastModifiedTimestamp The last time that the scaling group was updated in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Required: No scalingGroupName A unique identifier for the kdb scaling group. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. KxScalingGroup 338 Amazon FinSpace Management API Reference Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: No status The status of scaling groups. Type: String Valid Values: CREATING | CREATE_FAILED | ACTIVE | DELETING | DELETED | DELETE_FAILED Required: No statusReason The error message when a failed state occurs. Type: String Length Constraints: Minimum length of 1. Maximum length of 250. Pattern: ^[a-zA-Z0-9\_\-\.\s]+$ Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for |
api-reference-059 | api-reference.pdf | 59 | length of 3. Maximum length of 63. KxScalingGroup 338 Amazon FinSpace Management API Reference Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: No status The status of scaling groups. Type: String Valid Values: CREATING | CREATE_FAILED | ACTIVE | DELETING | DELETED | DELETE_FAILED Required: No statusReason The error message when a failed state occurs. Type: String Length Constraints: Minimum length of 1. Maximum length of 250. Pattern: ^[a-zA-Z0-9\_\-\.\s]+$ Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 KxScalingGroup 339 Amazon FinSpace Management API Reference KxScalingGroupConfiguration The structure that stores the capacity configuration details of a scaling group. Contents Note In the following list, the required parameters are described first. memoryReservation A reservation of the minimum amount of memory that should be available on the scaling group for a kdb cluster to be successfully placed in a scaling group. Type: Integer Valid Range: Minimum value of 6. Required: Yes nodeCount The number of kdb cluster nodes. Type: Integer Valid Range: Minimum value of 1. Required: Yes scalingGroupName A unique identifier for the kdb scaling group. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: Yes KxScalingGroupConfiguration 340 Amazon FinSpace cpu Management API Reference The number of vCPUs that you want to reserve for each node of this kdb cluster on the scaling group host. Type: Double Valid Range: Minimum value of 0.1. Required: No memoryLimit An optional hard limit on the amount of memory a kdb cluster can use. Type: Integer Valid Range: Minimum value of 6. Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 KxScalingGroupConfiguration 341 Management API Reference Amazon FinSpace KxUser A structure that stores metadata for a kdb user. Contents Note In the following list, the required parameters are described first. createTimestamp The timestamp at which the kdb user was created. Type: Timestamp Required: No iamRole The IAM role ARN that is associated with the user. Type: String Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws[a-z\-]*:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+$ Required: No updateTimestamp The timestamp at which the kdb user was updated. Type: Timestamp Required: No userArn The Amazon Resource Name (ARN) that identifies the user. For more information about ARNs and how to use ARNs in policies, see IAM Identifiers in the IAM User Guide. KxUser 342 Amazon FinSpace Type: String Management API Reference Length Constraints: Minimum length of 20. Maximum length of 2048. Pattern: ^arn:aws:finspace:[A-Za-z0-9_/.-]{0,63}:\d+:kxEnvironment/[0-9A- Za-z_-]{1,128}/kxUser/[0-9A-Za-z_-]{1,128}$ Required: No userName A unique identifier for the user. Type: String Length Constraints: Minimum length of 1. Maximum length of 50. Pattern: ^[0-9A-Za-z_-]{1,50}$ Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 KxUser 343 Amazon FinSpace KxVolume The structure that contains the metadata of the volume. Management API Reference Contents Note In the following list, the required parameters are described first. availabilityZoneIds The identifier of the availability zones. Type: Array of strings Length Constraints: Minimum length of 8. Maximum length of 12. Pattern: ^[a-zA-Z0-9-]+$ Required: No azMode The number of availability zones you want to assign per volume. Currently, FinSpace only supports SINGLE for volumes. This places dataview in a single AZ. Type: String Valid Values: SINGLE | MULTI Required: No createdTimestamp The timestamp at which the volume was created in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Required: No KxVolume 344 Amazon FinSpace description A description of the volume. Type: String Management API Reference Length Constraints: Minimum length of 1. Maximum length of 1000. Pattern: ^[a-zA-Z0-9. ]{1,1000}$ Required: No lastModifiedTimestamp The last time that the volume was updated in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Required: No status The status of volume. • CREATING – The volume creation is in progress. • CREATE_FAILED – The volume creation has failed. • ACTIVE – The volume is active. • UPDATING – The volume is in the process of being updated. • UPDATE_FAILED – The update action failed. • UPDATED – The volume is successfully updated. • DELETING – The volume is in the process of being deleted. • DELETE_FAILED – The system failed to delete the volume. • DELETED – The volume is successfully deleted. Type: String Valid |
api-reference-060 | api-reference.pdf | 60 | 12:00:00 PM UTC is specified as 1635768000000. Type: Timestamp Required: No status The status of volume. • CREATING – The volume creation is in progress. • CREATE_FAILED – The volume creation has failed. • ACTIVE – The volume is active. • UPDATING – The volume is in the process of being updated. • UPDATE_FAILED – The update action failed. • UPDATED – The volume is successfully updated. • DELETING – The volume is in the process of being deleted. • DELETE_FAILED – The system failed to delete the volume. • DELETED – The volume is successfully deleted. Type: String Valid Values: CREATING | CREATE_FAILED | ACTIVE | UPDATING | UPDATED | UPDATE_FAILED | DELETING | DELETED | DELETE_FAILED Required: No KxVolume 345 Amazon FinSpace statusReason Management API Reference The error message when a failed state occurs. Type: String Length Constraints: Minimum length of 1. Maximum length of 250. Pattern: ^[a-zA-Z0-9\_\-\.\s]+$ Required: No volumeName A unique identifier for the volume. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: No volumeType The type of file system volume. Currently, FinSpace only supports NAS_1 volume type. Type: String Valid Values: NAS_1 Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 KxVolume 346 Amazon FinSpace NetworkACLEntry Management API Reference The network access control list (ACL) is an optional layer of security for your VPC that acts as a firewall for controlling traffic in and out of one or more subnets. The entry is a set of numbered ingress and egress rules that determine whether a packet should be allowed in or out of a subnet associated with the ACL. We process the entries in the ACL according to the rule numbers, in ascending order. Contents Note In the following list, the required parameters are described first. cidrBlock The IPv4 network range to allow or deny, in CIDR notation. For example, 172.16.0.0/24. We modify the specified CIDR block to its canonical form. For example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18. Type: String Length Constraints: Minimum length of 1. Maximum length of 18. Pattern: ^(?:\d{1,3}\.){3}\d{1,3}(?:\/(?:3[0-2]|[12]\d|\d))$ Required: Yes protocol The protocol number. A value of -1 means all the protocols. Type: String Length Constraints: Minimum length of 1. Maximum length of 5. Pattern: ^-1|[0-9]+$ Required: Yes ruleAction Indicates whether to allow or deny the traffic that matches the rule. NetworkACLEntry 347 Amazon FinSpace Type: String Valid Values: allow | deny Required: Yes ruleNumber Management API Reference The rule number for the entry. For example 100. All the network ACL entries are processed in ascending order by rule number. Type: Integer Valid Range: Minimum value of 1. Maximum value of 32766. Required: Yes icmpTypeCode Defines the ICMP protocol that consists of the ICMP type and code. Type: IcmpTypeCode object Required: No portRange The range of ports the rule applies to. Type: PortRange object Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 NetworkACLEntry 348 Management API Reference Amazon FinSpace PortRange The range of ports the rule applies to. Contents Note In the following list, the required parameters are described first. from The first port in the range. Type: Integer Valid Range: Minimum value of 0. Maximum value of 65535. Required: Yes to The last port in the range. Type: Integer Valid Range: Minimum value of 0. Maximum value of 65535. Required: Yes See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 PortRange 349 Amazon FinSpace Management API Reference SuperuserParameters Configuration information for the superuser. Contents Note In the following list, the required parameters are described first. emailAddress The email address of the superuser. Type: String Length Constraints: Minimum length of 1. Maximum length of 128. Pattern: [A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+[.]+[A-Za-z]+ Required: Yes firstName The first name of the superuser. Type: String Length Constraints: Minimum length of 1. Maximum length of 50. Pattern: ^[a-zA-Z0-9]{1,50}$ Required: Yes lastName The last name of the superuser. Type: String Length Constraints: Minimum length of 1. Maximum length of 50. Pattern: ^[a-zA-Z0-9]{1,50}$ SuperuserParameters 350 Amazon FinSpace Required: Yes See Also Management API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 SuperuserParameters 351 Amazon FinSpace Management API Reference TickerplantLogConfiguration A configuration to store the Tickerplant logs. It |
api-reference-061 | api-reference.pdf | 61 | the superuser. Type: String Length Constraints: Minimum length of 1. Maximum length of 50. Pattern: ^[a-zA-Z0-9]{1,50}$ Required: Yes lastName The last name of the superuser. Type: String Length Constraints: Minimum length of 1. Maximum length of 50. Pattern: ^[a-zA-Z0-9]{1,50}$ SuperuserParameters 350 Amazon FinSpace Required: Yes See Also Management API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 SuperuserParameters 351 Amazon FinSpace Management API Reference TickerplantLogConfiguration A configuration to store the Tickerplant logs. It consists of a list of volumes that will be mounted to your cluster. For the cluster type Tickerplant, the location of the TP volume on the cluster will be available by using the global variable .aws.tp_log_path. Contents Note In the following list, the required parameters are described first. tickerplantLogVolumes The name of the volumes for tickerplant logs. Type: Array of strings Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 TickerplantLogConfiguration 352 Amazon FinSpace Management API Reference TransitGatewayConfiguration The structure of the transit gateway and network configuration that is used to connect the kdb environment to an internal network. Contents Note In the following list, the required parameters are described first. routableCIDRSpace The routing CIDR on behalf of kdb environment. It could be any "/26 range in the 100.64.0.0 CIDR space. After providing, it will be added to the customer's transit gateway routing table so that the traffics could be routed to kdb network. Type: String Required: Yes transitGatewayID The identifier of the transit gateway created by the customer to connect outbound traffics from kdb network to your internal network. Type: String Length Constraints: Minimum length of 1. Maximum length of 32. Required: Yes attachmentNetworkAclConfiguration The rules that define how you manage the outbound traffic from kdb network to your internal network. Type: Array of NetworkACLEntry objects Array Members: Minimum number of 1 item. Maximum number of 100 items. Required: No TransitGatewayConfiguration 353 Amazon FinSpace See Also Management API Reference For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 TransitGatewayConfiguration 354 Amazon FinSpace Volume The structure that consists of name and type of volume. Management API Reference Contents Note In the following list, the required parameters are described first. volumeName A unique identifier for the volume. Type: String Length Constraints: Minimum length of 3. Maximum length of 63. Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$ Required: No volumeType The type of file system volume. Currently, FinSpace only supports NAS_1 volume type. Type: String Valid Values: NAS_1 Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 Volume 355 Amazon FinSpace Management API Reference Volume 356 Amazon FinSpace VpcConfiguration Management API Reference Configuration details about the network where the Privatelink endpoint of the cluster resides. Contents Note In the following list, the required parameters are described first. ipAddressType The IP address type for cluster network configuration parameters. The following type is available: • IP_V4 – IP address version 4 Type: String Valid Values: IP_V4 Required: No securityGroupIds The unique identifier of the VPC security group applied to the VPC endpoint ENI for the cluster. Type: Array of strings Length Constraints: Minimum length of 1. Maximum length of 1024. Pattern: ^sg-([a-z0-9]{8}$|[a-z0-9]{17}$) Required: No subnetIds The identifier of the subnet that the Privatelink VPC endpoint uses to connect to the cluster. Type: Array of strings Length Constraints: Minimum length of 1. Maximum length of 1024. VpcConfiguration 357 Amazon FinSpace Management API Reference Pattern: ^subnet-([a-z0-9]{8}$|[a-z0-9]{17}$) Required: No vpcId The identifier of the VPC endpoint. Type: String Length Constraints: Minimum length of 1. Maximum length of 1024. Pattern: ^vpc-([a-z0-9]{8}$|[a-z0-9]{17}$) Required: No See Also For more information about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 Common Errors This section lists the errors common to the API actions of all AWS services. For errors specific to an API action for this service, see the topic for that API action. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 400 IncompleteSignature The request signature does not conform to AWS standards. HTTP Status Code: 400 Common Errors 358 Amazon FinSpace InternalFailure Management |
api-reference-062 | api-reference.pdf | 62 | about using this API in one of the language-specific AWS SDKs, see the following: • AWS SDK for C++ • AWS SDK for Java V2 • AWS SDK for Ruby V3 Common Errors This section lists the errors common to the API actions of all AWS services. For errors specific to an API action for this service, see the topic for that API action. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 400 IncompleteSignature The request signature does not conform to AWS standards. HTTP Status Code: 400 Common Errors 358 Amazon FinSpace InternalFailure Management API Reference The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 InvalidAction The action or operation requested is invalid. Verify that the action is typed correctly. HTTP Status Code: 400 InvalidClientTokenId The X.509 certificate or AWS access key ID provided does not exist in our records. HTTP Status Code: 403 NotAuthorized You do not have permission to perform this action. HTTP Status Code: 400 OptInRequired The AWS access key ID needs a subscription for the service. HTTP Status Code: 403 RequestExpired The request reached the service more than 15 minutes after the date stamp on the request or more than 15 minutes after the request expiration date (such as for pre-signed URLs), or the date stamp on the request is more than 15 minutes in the future. HTTP Status Code: 400 ServiceUnavailable The request has failed due to a temporary failure of the server. HTTP Status Code: 503 ThrottlingException The request was denied due to request throttling. Common Errors 359 Management API Reference Amazon FinSpace HTTP Status Code: 400 ValidationError The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 Common Parameters The following list contains the parameters that all actions use for signing Signature Version 4 requests with a query string. Any action-specific parameters are listed in the topic for that action. For more information about Signature Version 4, see Signing AWS API requests in the IAM User Guide. Action The action to be performed. Type: string Required: Yes Version The API version that the request is written for, expressed in the format YYYY-MM-DD. Type: string Required: Yes X-Amz-Algorithm The hash algorithm that you used to create the request signature. Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header. Type: string Valid Values: AWS4-HMAC-SHA256 Required: Conditional Common Parameters 360 Amazon FinSpace X-Amz-Credential Management API Reference The credential scope value, which is a string that includes your access key, the date, the region you are targeting, the service you are requesting, and a termination string ("aws4_request"). The value is expressed in the following format: access_key/YYYYMMDD/region/service/ aws4_request. For more information, see Create a signed AWS API request in the IAM User Guide. Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header. Type: string Required: Conditional X-Amz-Date The date that is used to create the signature. The format must be ISO 8601 basic format (YYYYMMDD'T'HHMMSS'Z'). For example, the following date time is a valid X-Amz-Date value: 20120325T120000Z. Condition: X-Amz-Date is optional for all requests; it can be used to override the date used for signing requests. If the Date header is specified in the ISO 8601 basic format, X-Amz-Date is not required. When X-Amz-Date is used, it always overrides the value of the Date header. For more information, see Elements of an AWS API request signature in the IAM User Guide. Type: string Required: Conditional X-Amz-Security-Token The temporary security token that was obtained through a call to AWS Security Token Service (AWS STS). For a list of services that support temporary security credentials from AWS STS, see AWS services that work with IAM in the IAM User Guide. Condition: If you're using temporary security credentials from AWS STS, you must include the security token. Type: string Required: Conditional Common Parameters 361 Amazon FinSpace X-Amz-Signature Management API Reference Specifies the hex-encoded signature that was calculated from the string to sign and the derived signing key. Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header. Type: string Required: Conditional X-Amz-SignedHeaders Specifies all the HTTP headers that were included as part of the canonical request. For more information about specifying signed headers, see Create a signed AWS API request in the IAM User Guide. Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header. Type: string Required: Conditional Common Parameters 362 Amazon FinSpace Management API Reference AWS Glossary For the latest AWS terminology, see the AWS glossary in the AWS Glossary Reference. 363 |
apigateway-dg-001 | apigateway-dg.pdf | 1 | Developer Guide Amazon API Gateway Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon API Gateway Developer Guide Amazon API Gateway: Developer Guide Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon. Amazon API Gateway Table of Contents Developer Guide What is Amazon API Gateway? ....................................................................................................... 1 Architecture of API Gateway ...................................................................................................................... 2 Features of API Gateway ............................................................................................................................. 2 API Gateway use cases ................................................................................................................................ 3 Use API Gateway to create REST APIs ................................................................................................ 3 Use API Gateway to create HTTP APIs ............................................................................................... 4 Use API Gateway to create WebSocket APIs ..................................................................................... 5 Who uses API Gateway? ........................................................................................................................ 5 Accessing API Gateway ................................................................................................................................ 6 Part of AWS serverless infrastructure ...................................................................................................... 7 How to get started with Amazon API Gateway ..................................................................................... 7 API Gateway concepts ................................................................................................................................. 7 Choose between REST APIs and HTTP APIs ......................................................................................... 13 .................................................................................................................................................................. 13 Endpoint type ........................................................................................................................................ 13 Security ................................................................................................................................................... 14 Authorization ......................................................................................................................................... 14 API management .................................................................................................................................. 15 Development .......................................................................................................................................... 15 Monitoring .............................................................................................................................................. 16 Integrations ............................................................................................................................................ 17 Get started with the REST API console ................................................................................................. 18 Step 1: Create a Lambda function .................................................................................................... 19 Step 2: Create a REST API .................................................................................................................. 20 Step 3: Create a Lambda proxy integration .................................................................................... 20 Step 4: Deploy your API ...................................................................................................................... 20 Step 5: Invoke your API ....................................................................................................................... 21 (Optional) Step 6: Clean up ................................................................................................................ 22 Prerequisites .................................................................................................................................. 24 Sign up for an AWS account ................................................................................................................... 24 Create a user with administrative access .............................................................................................. 24 Get started ..................................................................................................................................... 26 Step 1: Create a Lambda function ......................................................................................................... 27 Step 2: Create an HTTP API ..................................................................................................................... 27 iii Amazon API Gateway Developer Guide Step 3: Test your API ................................................................................................................................ 28 (Optional) Step 4: Clean up ..................................................................................................................... 29 Next steps .................................................................................................................................................... 30 Tutorials and workshops ............................................................................................................... 32 REST API tutorials ...................................................................................................................................... 33 Choose a Lambda integration tutorial ............................................................................................. 33 Tutorial: Create a REST API by importing an example .................................................................. 57 Choose an HTTP integration tutorial ............................................................................................... 66 Tutorial: Create a REST API with a private integration ................................................................. 80 Tutorial: Create a REST API with an AWS integration ................................................................... 83 Tutorial: Create a calculator REST API with three integrations ................................................... 89 Tutorial: Create a REST API as an Amazon S3 proxy .................................................................. 116 Tutorial: Create a REST API as an Amazon Kinesis proxy ........................................................... 160 Tutorial: Create a REST API using AWS SDKs or the AWS CLI ................................................... 205 Tutorial: Create a private REST API ................................................................................................ 239 HTTP API tutorials ................................................................................................................................... 245 Tutorial: Build a CRUD HTTP API with Lambda and DynamoDB .............................................. 245 Tutorial: Create an HTTP API with a private integration to Amazon ECS ................................ 258 WebSocket API tutorials ......................................................................................................................... 265 Tutorial: Create a WebSocket chat app ......................................................................................... 265 Tutorial: Create a WebSocket API with an AWS integration ...................................................... 271 API Gateway REST APIs ............................................................................................................... 284 Develop ...................................................................................................................................................... 284 Example resource for a REST API ................................................................................................... 285 Additional REST API features for development ........................................................................... 288 API Gateway endpoint types ............................................................................................................ 290 IP address types for REST APIs in API Gateway ........................................................................... 294 Methods ................................................................................................................................................ 296 Access control ...................................................................................................................................... 315 Integrations .......................................................................................................................................... 400 Request validation .............................................................................................................................. 467 Data transformations ......................................................................................................................... 497 Gateway responses ............................................................................................................................. 578 CORS ...................................................................................................................................................... 589 Binary media types ............................................................................................................................ 603 Invoke .................................................................................................................................................... 634 iv Amazon API Gateway Developer Guide OpenAPI ................................................................................................................................................ 667 Publish ........................................................................................................................................................ 681 Deploy REST APIs ............................................................................................................................... 682 Custom domain names ..................................................................................................................... 724 Optimize ..................................................................................................................................................... 767 Cache settings ..................................................................................................................................... 768 Content encoding ............................................................................................................................... 780 Distribute ................................................................................................................................................... 786 Usage plans .......................................................................................................................................... 787 API documentation ............................................................................................................................. 813 SDK generation ................................................................................................................................... 876 Sell your APIs as SaaS ....................................................................................................................... 904 Protect ........................................................................................................................................................ 908 Mutual TLS ........................................................................................................................................... 909 Client certificates ................................................................................................................................ 916 AWS WAF .............................................................................................................................................. 957 Throttling ............................................................................................................................................. 960 Private REST APIs ............................................................................................................................... 962 Monitor .................................................................................................................................................... 1017 CloudWatch metrics ......................................................................................................................... 1018 CloudWatch logs .............................................................................................................................. 1027 Firehose .............................................................................................................................................. 1032 Variables for access logging for API Gateway ............................................................................ 1033 X-Ray ................................................................................................................................................... 1045 API Gateway HTTP APIs ............................................................................................................ 1060 Develop .................................................................................................................................................... 1060 Creating an HTTP API ..................................................................................................................... 1061 Routes ................................................................................................................................................. 1062 IP address types for HTTP APIs in API Gateway ........................................................................ 1065 Access control ................................................................................................................................... 1067 Integrations ....................................................................................................................................... 1086 CORS ................................................................................................................................................... 1107 Parameter mapping ......................................................................................................................... 1110 OpenAPI ............................................................................................................................................. 1117 Publish ..................................................................................................................................................... 1127 Stages ................................................................................................................................................. 1127 v Amazon API Gateway Developer Guide Security policy for HTTP APIs in API Gateway ........................................................................... 1130 Custom domain names ................................................................................................................... 1132 Protect ...................................................................................................................................................... 1141 Throttling ........................................................................................................................................... 1142 Mutual TLS ......................................................................................................................................... 1143 Monitor .................................................................................................................................................... 1149 Metrics ................................................................................................................................................ 1150 Logging ............................................................................................................................................... 1152 Troubleshooting ..................................................................................................................................... 1162 Lambda integrations ........................................................................................................................ |
apigateway-dg-002 | apigateway-dg.pdf | 2 | ................................................................................................................................................... 1045 API Gateway HTTP APIs ............................................................................................................ 1060 Develop .................................................................................................................................................... 1060 Creating an HTTP API ..................................................................................................................... 1061 Routes ................................................................................................................................................. 1062 IP address types for HTTP APIs in API Gateway ........................................................................ 1065 Access control ................................................................................................................................... 1067 Integrations ....................................................................................................................................... 1086 CORS ................................................................................................................................................... 1107 Parameter mapping ......................................................................................................................... 1110 OpenAPI ............................................................................................................................................. 1117 Publish ..................................................................................................................................................... 1127 Stages ................................................................................................................................................. 1127 v Amazon API Gateway Developer Guide Security policy for HTTP APIs in API Gateway ........................................................................... 1130 Custom domain names ................................................................................................................... 1132 Protect ...................................................................................................................................................... 1141 Throttling ........................................................................................................................................... 1142 Mutual TLS ......................................................................................................................................... 1143 Monitor .................................................................................................................................................... 1149 Metrics ................................................................................................................................................ 1150 Logging ............................................................................................................................................... 1152 Troubleshooting ..................................................................................................................................... 1162 Lambda integrations ........................................................................................................................ 1162 JWT authorizers ................................................................................................................................ 1165 API Gateway WebSocket APIs ................................................................................................... 1167 Overview of WebSocket APIs .............................................................................................................. 1167 Use routes for a WebSocket API ................................................................................................... 1168 Send data to connected client apps ............................................................................................ 1169 Manage connected users and client apps ................................................................................... 1169 Invoke your backend integration .................................................................................................. 1172 WebSocket selection expressions ................................................................................................. 1177 Develop .................................................................................................................................................... 1185 Create and configure ....................................................................................................................... 1186 IP address types for WebSocket APIs in API Gateway .............................................................. 1187 Routes ................................................................................................................................................. 1189 Access control ................................................................................................................................... 1197 Integrations ....................................................................................................................................... 1206 Request validation ........................................................................................................................... 1215 Data transformations ...................................................................................................................... 1218 Binary media types .......................................................................................................................... 1230 Invoke .................................................................................................................................................. 1230 Publish ..................................................................................................................................................... 1233 Stages ................................................................................................................................................. 1234 Deploy a WebSocket API ................................................................................................................ 1236 Security policy for WebSocket APIs in API Gateway ................................................................. 1239 Custom domain names ................................................................................................................... 1241 Protect ...................................................................................................................................................... 1249 Account-level throttling per Region ............................................................................................. 1249 Route-level throttling ...................................................................................................................... 1250 vi Amazon API Gateway Developer Guide Monitor .................................................................................................................................................... 1250 Metrics ................................................................................................................................................ 1251 Logging ............................................................................................................................................... 1253 API Gateway ARNs ..................................................................................................................... 1261 HTTP API and WebSocket API resources .......................................................................................... 1261 REST API resources ................................................................................................................................ 1264 execute-api (HTTP APIs, WebSocket APIs, and REST APIs) ...................................................... 1269 OpenAPI extensions .................................................................................................................. 1271 x-amazon-apigateway-any-method ........................................................................................... 1272 x-amazon-apigateway-any-method examples ........................................................................... 1273 x-amazon-apigateway-cors .................................................................................................................. 1274 x-amazon-apigateway-cors example ............................................................................................ 1274 x-amazon-apigateway-api-key-source ................................................................................. 1275 x-amazon-apigateway-api-key-source example ......................................................................... 1275 x-amazon-apigateway-auth ......................................................................................................... 1276 x-amazon-apigateway-auth example ........................................................................................... 1277 x-amazon-apigateway-authorizer ........................................................................................... 1277 x-amazon-apigateway-authorizer examples for REST APIs ..................................................... 1280 x-amazon-apigateway-authorizer examples for HTTP APIs .................................................... 1284 x-amazon-apigateway-authtype ................................................................................................ 1286 x-amazon-apigateway-authtype example ................................................................................... 1286 See also .............................................................................................................................................. 1288 x-amazon-apigateway-binary-media-type ....................................................................................... 1289 x-amazon-apigateway-binary-media-types example ................................................................ 1289 x-amazon-apigateway-documentation ............................................................................................. 1289 x-amazon-apigateway-documentation example ....................................................................... 1289 x-amazon-apigateway-endpoint-configuration ............................................................................... 1290 x-amazon-apigateway-endpoint-configuration examples ....................................................... 1291 x-amazon-apigateway-gateway-responses ...................................................................................... 1292 x-amazon-apigateway-gateway-responses example ................................................................ 1292 x-amazon-apigateway-gateway-responses.gatewayResponse ..................................................... 1293 x-amazon-apigateway-gateway-responses.gatewayResponse example ............................... 1293 x-amazon-apigateway-gateway-responses.responseParameters ................................................. 1294 x-amazon-apigateway-gateway-responses.responseParameters example ........................... 1294 x-amazon-apigateway-gateway-responses.responseTemplates .................................................. 1295 x-amazon-apigateway-gateway-responses.responseTemplates example ............................. 1295 vii Amazon API Gateway Developer Guide x-amazon-apigateway-importexport-version .................................................................................. 1296 x-amazon-apigateway-importexport-version example ............................................................ 1296 x-amazon-apigateway-integration ........................................................................................ 1296 x-amazon-apigateway-integration examples ............................................................................. 1302 x-amazon-apigateway-integrations ................................................................................................... 1304 x-amazon-apigateway-integrations example ............................................................................. 1304 x-amazon-apigateway-integration.requestTemplates .................................................................... 1306 x-amazon-apigateway-integration.requestTemplates example .............................................. 1306 x-amazon-apigateway-integration.requestParameters .................................................................. 1307 x-amazon-apigateway-integration.requestParameters example ....................... 1308 x-amazon-apigateway-integration.responses .................................................................................. 1308 x-amazon-apigateway-integration.responses example ........................................... 1310 x-amazon-apigateway-integration.response .................................................................................... 1310 x-amazon-apigateway-integration.response example ............................................. 1312 x-amazon-apigateway-integration.responseTemplates ................................................................. 1312 x-amazon-apigateway-integration.responseTemplate example ............................................. 1313 x-amazon-apigateway-integration.responseParameters ............................................................... 1313 x-amazon-apigateway-integration.responseParameters example ..................... 1314 x-amazon-apigateway-integration.tlsConfig .................................................................................... 1314 x-amazon-apigateway-integration.tlsConfig examples ............................................................ 1316 x-amazon-apigateway-minimum-compression-size ....................................................................... 1317 x-amazon-apigateway-minimum-compression-size example ................................................. 1317 x-amazon-apigateway-policy .............................................................................................................. 1317 x-amazon-apigateway-policy example .............................................................................. 1317 x-amazon-apigateway-request-validator .......................................................................................... 1318 x-amazon-apigateway-request-validator example .................................................... 1318 x-amazon-apigateway-request-validators ........................................................................................ 1319 x-amazon-apigateway-request-validators example .................................................. 1320 x-amazon-apigateway-request-validators.requestValidator ......................................................... 1320 x-amazon-apigateway-request-validators.requestValidator example ......... 1321 x-amazon-apigateway-tag-value ........................................................................................................ 1321 x-amazon-apigateway-tag-value example ....................................................................... 1322 Security ...................................................................................................................................... 1323 Data protection ...................................................................................................................................... 1324 Data encryption ................................................................................................................................ 1325 Internetwork traffic privacy ........................................................................................................... 1327 viii Amazon API Gateway Developer Guide Identity and access management ...................................................................................................... 1327 Audience ............................................................................................................................................. 1328 Authenticating with identities ....................................................................................................... 1328 Managing access using policies ..................................................................................................... 1331 How Amazon API Gateway works with IAM ............................................................................... 1334 Identity-based policy examples ..................................................................................................... 1339 Resource-based policy examples .................................................................................................. 1347 Troubleshooting ................................................................................................................................ 1347 Using service-linked roles ............................................................................................................... 1349 Logging and monitoring ...................................................................................................................... 1354 Working with CloudTrail ................................................................................................................. 1355 Working with AWS Config .............................................................................................................. 1358 Compliance validation .......................................................................................................................... 1362 Resilience ................................................................................................................................................. 1363 Infrastructure security .......................................................................................................................... 1363 Configuration and vulnerability analysis .......................................................................................... 1364 Best practices ......................................................................................................................................... 1364 Tagging ....................................................................................................................................... 1366 API Gateway resources that can be tagged ..................................................................................... 1366 Tag inheritance in the Amazon API Gateway V1 API ................................................................ 1368 Tag restrictions and usage conventions ...................................................................................... 1369 Attribute-based access control ........................................................................................................... 1369 Limit actions based on resource tags .......................................................................................... 1370 Allow actions based on resource tags ......................................................................................... 1371 Deny tagging operations ................................................................................................................ 1372 Allow tagging operations ............................................................................................................... 1372 API references ............................................................................................................................ 1374 API Gateway service endpoints .......................................................................................................... 1374 IPv4 endpoints .................................................................................................................................. 1374 Dualstack (IPv4 and IPv6) endpoints ........................................................................................... 1375 Specifying endpoints ....................................................................................................................... 1375 Using IPv6 addresses in IAM policies ................................................................................................ 1376 Quotas and important notes .................................................................................................... 1378 API Gateway account-level quotas, per Region ............................................................................... 1378 API Gateway quotas for creating, deploying and managing an API ............................................ 1378 REST API quotas .................................................................................................................................... 1381 ix Amazon API Gateway Developer Guide Best practices to reduce your quotas .......................................................................................... 1386 HTTP API quotas ................................................................................................................................... 1387 ............................................................................................................................................................. 1387 Best practices to reduce your quotas .......................................................................................... 1390 WebSocket API quotas ......................................................................................................................... 1390 Important notes ..................................................................................................................................... 1393 Important notes for REST APIs, HTTP APIs, and WebSocket APIs ......................................... 1393 Amazon API Gateway important notes for HTTP APIs ............................................................. 1394 Important notes |
apigateway-dg-003 | apigateway-dg.pdf | 3 | IPv6 addresses in IAM policies ................................................................................................ 1376 Quotas and important notes .................................................................................................... 1378 API Gateway account-level quotas, per Region ............................................................................... 1378 API Gateway quotas for creating, deploying and managing an API ............................................ 1378 REST API quotas .................................................................................................................................... 1381 ix Amazon API Gateway Developer Guide Best practices to reduce your quotas .......................................................................................... 1386 HTTP API quotas ................................................................................................................................... 1387 ............................................................................................................................................................. 1387 Best practices to reduce your quotas .......................................................................................... 1390 WebSocket API quotas ......................................................................................................................... 1390 Important notes ..................................................................................................................................... 1393 Important notes for REST APIs, HTTP APIs, and WebSocket APIs ......................................... 1393 Amazon API Gateway important notes for HTTP APIs ............................................................. 1394 Important notes for REST APIs and WebSocket APIs ............................................................... 1394 Important notes for WebSocket APIs .......................................................................................... 1394 Important notes for REST APIs ..................................................................................................... 1394 Document history ...................................................................................................................... 1401 Earlier updates ....................................................................................................................................... 1411 x Amazon API Gateway Developer Guide What is Amazon API Gateway? Amazon API Gateway is an AWS service for creating, publishing, maintaining, monitoring, and securing REST, HTTP, and WebSocket APIs at any scale. API developers can create APIs that access AWS or other web services, as well as data stored in the AWS Cloud. As an API Gateway API developer, you can create APIs for use in your own client applications. Or you can make your APIs available to third-party app developers. For more information, see the section called “Who uses API Gateway?”. API Gateway creates RESTful APIs that: • Are HTTP-based. • Enable stateless client-server communication. • Implement standard HTTP methods such as GET, POST, PUT, PATCH, and DELETE. For more information about API Gateway REST APIs and HTTP APIs, see the section called “Choose between REST APIs and HTTP APIs ”, API Gateway HTTP APIs, the section called “Use API Gateway to create REST APIs”, and the section called “Develop”. API Gateway creates WebSocket APIs that: • Adhere to the WebSocket protocol, which enables stateful, full-duplex communication between client and server. • Route incoming messages based on message content. For more information about API Gateway WebSocket APIs, see the section called “Use API Gateway to create WebSocket APIs” and the section called “Overview of WebSocket APIs”. Topics • Architecture of API Gateway • Features of API Gateway • API Gateway use cases • Accessing API Gateway • Part of AWS serverless infrastructure • How to get started with Amazon API Gateway 1 Amazon API Gateway • Amazon API Gateway concepts • Choose between REST APIs and HTTP APIs • Get started with the REST API console Architecture of API Gateway The following diagram shows API Gateway architecture. Developer Guide This diagram illustrates how the APIs you build in Amazon API Gateway provide you or your developer customers with an integrated and consistent developer experience for building AWS serverless applications. API Gateway handles all the tasks involved in accepting and processing up to hundreds of thousands of concurrent API calls. These tasks include traffic management, authorization and access control, monitoring, and API version management. API Gateway acts as a "front door" for applications to access data, business logic, or functionality from your backend services, such as workloads running on Amazon Elastic Compute Cloud (Amazon EC2), code running on AWS Lambda, any web application, or real-time communication applications. Features of API Gateway Amazon API Gateway offers features such as the following: Architecture of API Gateway 2 Amazon API Gateway Developer Guide • Support for stateful (WebSocket) and stateless (HTTP and REST) APIs. • Powerful, flexible authentication mechanisms, such as AWS Identity and Access Management policies, Lambda authorizer functions, and Amazon Cognito user pools. • Canary release deployments for safely rolling out changes. • CloudTrail logging and monitoring of API usage and API changes. • CloudWatch access logging and execution logging, including the ability to set alarms. For more information, see the section called “CloudWatch metrics” and the section called “Metrics”. • Ability to use AWS CloudFormation templates to enable API creation. For more information, see Amazon API Gateway Resource Types Reference and Amazon API Gateway V2 Resource Types Reference. • Support for custom domain names. • Integration with AWS WAF for protecting your APIs against common web exploits. • Integration with AWS X-Ray for understanding and triaging performance latencies. For a complete list of API Gateway feature releases, see Document history. API Gateway use cases The following use cases section presents an overview of the different types of API Gateway APIs and the different kinds of developers who use API Gateway. For more detailed information about the difference between REST APIs and HTTP APIs, see the section called “Choose between REST APIs and HTTP APIs ”. Topics • Use API Gateway to create REST APIs • Use API Gateway to create HTTP APIs • Use API Gateway to create WebSocket APIs • Who uses API Gateway? Use API Gateway to create REST APIs An API Gateway REST API is made |
apigateway-dg-004 | apigateway-dg.pdf | 4 | history. API Gateway use cases The following use cases section presents an overview of the different types of API Gateway APIs and the different kinds of developers who use API Gateway. For more detailed information about the difference between REST APIs and HTTP APIs, see the section called “Choose between REST APIs and HTTP APIs ”. Topics • Use API Gateway to create REST APIs • Use API Gateway to create HTTP APIs • Use API Gateway to create WebSocket APIs • Who uses API Gateway? Use API Gateway to create REST APIs An API Gateway REST API is made up of resources and methods. A resource is a logical entity that an app can access through a resource path. A method corresponds to a REST API request that is submitted by the user of your API and the response returned to the user. API Gateway use cases 3 Amazon API Gateway Developer Guide For example, /incomes could be the path of a resource representing the income of the app user. A resource can have one or more operations that are defined by appropriate HTTP verbs such as GET, POST, PUT, PATCH, and DELETE. A combination of a resource path and an operation identifies a method of the API. For example, a POST /incomes method could add an income earned by the caller, and a GET /expenses method could query the reported expenses incurred by the caller. The app doesn't need to know where the requested data is stored and fetched from on the backend. In API Gateway REST APIs, the frontend is encapsulated by method requests and method responses. The API interfaces with the backend by means of integration requests and integration responses. For example, with DynamoDB as the backend, the API developer sets up the integration request to forward the incoming method request to the chosen backend. The setup includes specifications of an appropriate DynamoDB action, required IAM role and policies, and required input data transformation. The backend returns the result to API Gateway as an integration response. To route the integration response to an appropriate method response (of a given HTTP status code) to the client, you can configure the integration response to map required response parameters from integration to method. You then translate the output data format of the backend to that of the frontend, if necessary. API Gateway enables you to define a schema or model for the payload to facilitate setting up the body mapping template. API Gateway provides REST API management functionality such as the following: • Support for generating SDKs and creating API documentation using API Gateway extensions to OpenAPI • Throttling of HTTP requests Use API Gateway to create HTTP APIs HTTP APIs enable you to create RESTful APIs with lower latency and lower cost than REST APIs. You can use HTTP APIs to send requests to AWS Lambda functions or to any publicly routable HTTP endpoint. For example, you can create an HTTP API that integrates with a Lambda function on the backend. When a client calls your API, API Gateway sends the request to the Lambda function and returns the function's response to the client. Use API Gateway to create HTTP APIs 4 Amazon API Gateway Developer Guide HTTP APIs support OpenID Connect and OAuth 2.0 authorization. They come with built-in support for cross-origin resource sharing (CORS) and automatic deployments. To learn more, see the section called “Choose between REST APIs and HTTP APIs ”. Use API Gateway to create WebSocket APIs In a WebSocket API, the client and the server can both send messages to each other at any time. Backend servers can easily push data to connected users and devices, avoiding the need to implement complex polling mechanisms. For example, you could build a serverless application using an API Gateway WebSocket API and AWS Lambda to send and receive messages to and from individual users or groups of users in a chat room. Or you could invoke backend services such as AWS Lambda, Amazon Kinesis, or an HTTP endpoint based on message content. You can use API Gateway WebSocket APIs to build secure, real-time communication applications without having to provision or manage any servers to manage connections or large-scale data exchanges. Targeted use cases include real-time applications such as the following: • Chat applications • Real-time dashboards such as stock tickers • Real-time alerts and notifications API Gateway provides WebSocket API management functionality such as the following: • Monitoring and throttling of connections and messages • Using AWS X-Ray to trace messages as they travel through the APIs to backend services • Easy integration with HTTP/HTTPS endpoints Who uses API Gateway? There are two kinds of developers who use API Gateway: API developers and app developers. An API developer creates and deploys an API to enable the |
apigateway-dg-005 | apigateway-dg.pdf | 5 | or large-scale data exchanges. Targeted use cases include real-time applications such as the following: • Chat applications • Real-time dashboards such as stock tickers • Real-time alerts and notifications API Gateway provides WebSocket API management functionality such as the following: • Monitoring and throttling of connections and messages • Using AWS X-Ray to trace messages as they travel through the APIs to backend services • Easy integration with HTTP/HTTPS endpoints Who uses API Gateway? There are two kinds of developers who use API Gateway: API developers and app developers. An API developer creates and deploys an API to enable the required functionality in API Gateway. The API developer must be a user in the AWS account that owns the API. An app developer builds a functioning application to call AWS services by invoking a WebSocket or REST API created by an API developer in API Gateway. Use API Gateway to create WebSocket APIs 5 Amazon API Gateway Developer Guide The app developer is the customer of the API developer. The app developer doesn't need to have an AWS account, provided that the API either doesn't require IAM permissions or supports authorization of users through third-party federated identity providers supported by Amazon Cognito user pool identity federation. Such identity providers include Amazon, Amazon Cognito user pools, Facebook, and Google. Creating and managing an API Gateway API An API developer works with the API Gateway service component for API management, named apigateway, to create, configure, and deploy an API. As an API developer, you can create and manage an API by using the API Gateway console, described in Get started with API Gateway, or by calling the API references. There are several ways to call this API. They include using the AWS Command Line Interface (AWS CLI), or by using an AWS SDK. In addition, you can enable API creation with AWS CloudFormation templates or (in the case of REST APIs and HTTP APIs) OpenAPI extensions for API Gateway. For a list of Regions where API Gateway is available, as well as the associated control service endpoints, see Amazon API Gateway Endpoints and Quotas. Calling an API Gateway API An app developer works with the API Gateway service component for API execution, named execute-api, to invoke an API that was created or deployed in API Gateway. The underlying programming entities are exposed by the created API. There are several ways to call such an API. To learn more, see Invoke REST APIs in API Gateway and Invoke WebSocket APIs. Accessing API Gateway You can access Amazon API Gateway in the following ways: • AWS Management Console – The AWS Management Console provides a web interface for creating and managing APIs. After you complete the steps in Prerequisites, you can access the API Gateway console at https://console.aws.amazon.com/apigateway. • AWS SDKs – If you're using a programming language that AWS provides an SDK for, you can use an SDK to access API Gateway. SDKs simplify authentication, integrate easily with your development environment, and provide access to API Gateway commands. For more information, see Tools for Amazon Web Services. Accessing API Gateway 6 Amazon API Gateway Developer Guide • API Gateway V1 and V2 APIs – If you're using a programming language that an SDK isn't available for, see the Amazon API Gateway Version 1 API Reference and Amazon API Gateway Version 2 API Reference. • AWS Command Line Interface – For more information, see Getting Set Up with the AWS Command Line Interface in the AWS Command Line Interface User Guide. • AWS Tools for Windows PowerShell – For more information, see Setting Up the AWS Tools for Windows PowerShell in the AWS Tools for Windows PowerShell User Guide. Part of AWS serverless infrastructure Together with AWS Lambda, API Gateway forms the app-facing part of the AWS serverless infrastructure. To learn more about getting started with serverless, see the Serverless Developer Guide. For an app to call publicly available AWS services, you can use Lambda to interact with required services and expose Lambda functions through API methods in API Gateway. AWS Lambda runs your code on a highly available computing infrastructure. It performs the necessary execution and administration of computing resources. To enable serverless applications, API Gateway supports streamlined proxy integrations with AWS Lambda and HTTP endpoints. How to get started with Amazon API Gateway For an introduction to Amazon API Gateway, see the following: • Get started, which provides a walkthrough for creating an HTTP API. • Serverless land, which provides instructional videos. • Happy Little API Shorts, which is a series of brief instructional videos. Amazon API Gateway concepts The following section describes introductory concepts for using API Gateway. API Gateway API Gateway is an AWS service that supports the following: Part of AWS serverless infrastructure 7 Amazon API Gateway Developer Guide |
apigateway-dg-006 | apigateway-dg.pdf | 6 | applications, API Gateway supports streamlined proxy integrations with AWS Lambda and HTTP endpoints. How to get started with Amazon API Gateway For an introduction to Amazon API Gateway, see the following: • Get started, which provides a walkthrough for creating an HTTP API. • Serverless land, which provides instructional videos. • Happy Little API Shorts, which is a series of brief instructional videos. Amazon API Gateway concepts The following section describes introductory concepts for using API Gateway. API Gateway API Gateway is an AWS service that supports the following: Part of AWS serverless infrastructure 7 Amazon API Gateway Developer Guide • Creating, deploying, and managing a RESTful application programming interface (API) to expose backend HTTP endpoints, AWS Lambda functions, or other AWS services. • Creating, deploying, and managing a WebSocket API to expose AWS Lambda functions or other AWS services. • Invoking exposed API methods through the frontend HTTP and WebSocket endpoints. API Gateway REST API A collection of HTTP resources and methods that are integrated with backend HTTP endpoints, Lambda functions, or other AWS services. You can deploy this collection in one or more stages. Typically, API resources are organized in a resource tree according to the application logic. Each API resource can expose one or more API methods that have unique HTTP verbs supported by API Gateway. For more information, see the section called “Choose between REST APIs and HTTP APIs ”. API Gateway HTTP API A collection of routes and methods that are integrated with backend HTTP endpoints or Lambda functions. You can deploy this collection in one or more stages. Each route can expose one or more API methods that have unique HTTP verbs supported by API Gateway. For more information, see the section called “Choose between REST APIs and HTTP APIs ”. API Gateway WebSocket API A collection of WebSocket routes and route keys that are integrated with backend HTTP endpoints, Lambda functions, or other AWS services. You can deploy this collection in one or more stages. API methods are invoked through frontend WebSocket connections that you can associate with a registered custom domain name. API deployment A point-in-time snapshot of your API Gateway API. To be available for clients to use, the deployment must be associated with one or more API stages. API developer Your AWS account that owns an API Gateway deployment (for example, a service provider that also supports programmatic access). API endpoint A hostname for an API in API Gateway that is deployed to a specific Region. The hostname is of the form {api-id}.execute-api.{region}.amazonaws.com. The following types of API endpoints are supported: API Gateway concepts 8 Amazon API Gateway Developer Guide • Edge-optimized API endpoint • Private API endpoint • Regional API endpoint API key An alphanumeric string that API Gateway uses to identify an app developer who uses your REST or WebSocket API. API Gateway can generate API keys on your behalf, or you can import them from a CSV file. You can use API keys together with Lambda authorizers or usage plans to control access to your APIs. See API endpoints. API owner See API developer. API stage A logical reference to a lifecycle state of your API (for example, 'dev', 'prod', 'beta', 'v2'). API stages are identified by API ID and stage name. App developer An app creator who may or may not have an AWS account and interacts with the API that you, the API developer, have deployed. App developers are your customers. An app developer is typically identified by an API key. Callback URL When a new client is connected to through a WebSocket connection, you can call an integration in API Gateway to store the client's callback URL. You can then use that callback URL to send messages to the client from the backend system. Developer portal An application that allows your customers to register, discover, and subscribe to your API products (API Gateway usage plans), manage their API keys, and view their usage metrics for your APIs. Edge-optimized API endpoint The default hostname of an API Gateway API that is deployed to the specified Region while using a CloudFront distribution to facilitate client access typically from across AWS Regions. API API Gateway concepts 9 Amazon API Gateway Developer Guide requests are routed to the nearest CloudFront Point of Presence (POP), which typically improves connection time for geographically diverse clients. See API endpoints. Integration request The internal interface of a WebSocket API route or REST API method in API Gateway, in which you map the body of a route request or the parameters and body of a method request to the formats required by the backend. Integration response The internal interface of a WebSocket API route or REST API method in API Gateway, in which you map the status codes, headers, and payload that are |
apigateway-dg-007 | apigateway-dg.pdf | 7 | Amazon API Gateway Developer Guide requests are routed to the nearest CloudFront Point of Presence (POP), which typically improves connection time for geographically diverse clients. See API endpoints. Integration request The internal interface of a WebSocket API route or REST API method in API Gateway, in which you map the body of a route request or the parameters and body of a method request to the formats required by the backend. Integration response The internal interface of a WebSocket API route or REST API method in API Gateway, in which you map the status codes, headers, and payload that are received from the backend to the response format that is returned to a client app. Mapping template A script in Velocity Template Language (VTL) that transforms a request body from the frontend data format to the backend data format, or that transforms a response body from the backend data format to the frontend data format. Mapping templates can be specified in the integration request or in the integration response. They can reference data made available at runtime as context and stage variables. The mapping can be as simple as an identity transform that passes the headers or body through the integration as-is from the client to the backend for a request. The same is true for a response, in which the payload is passed from the backend to the client. Method request The public interface of an API method in API Gateway that defines the parameters and body that an app developer must send in requests to access the backend through the API. Method response The public interface of a REST API that defines the status codes, headers, and body models that an app developer should expect in responses from the API. Mock integration In a mock integration, API responses are generated from API Gateway directly, without the need for an integration backend. As an API developer, you decide how API Gateway responds to a mock integration request. For this, you configure the method's integration request and integration response to associate a response with a given status code. API Gateway concepts 10 Amazon API Gateway Model Developer Guide A data schema specifying the data structure of a request or response payload. A model is required for generating a strongly typed SDK of an API. It is also used to validate payloads. A model is convenient for generating a sample mapping template to initiate creation of a production mapping template. Although useful, a model is not required for creating a mapping template. Private API See Private API endpoint. Private API endpoint An API endpoint that is exposed through interface VPC endpoints and allows a client to securely access private API resources inside a VPC. Private APIs are isolated from the public internet, and they can only be accessed using VPC endpoints for API Gateway that have been granted access. Private integration An API Gateway integration type for a client to access resources inside a customer's VPC through a private REST API endpoint without exposing the resources to the public internet. Proxy integration A simplified API Gateway integration configuration. You can set up a proxy integration as an HTTP proxy integration or a Lambda proxy integration. For HTTP proxy integration, API Gateway passes the entire request and response between the frontend and an HTTP backend. For Lambda proxy integration, API Gateway sends the entire request as input to a backend Lambda function. API Gateway then transforms the Lambda function output to a frontend HTTP response. In REST APIs, proxy integration is most commonly used with a proxy resource, which is represented by a greedy path variable (for example, {proxy+}) combined with a catch-all ANY method. Quick create You can use quick create to simplify creating an HTTP API. Quick create creates an API with a Lambda or HTTP integration, a default catch-all route, and a default stage that is configured to automatically deploy changes. For more information, see the section called “Create an HTTP API by using the AWS CLI”. API Gateway concepts 11 Amazon API Gateway Regional API endpoint Developer Guide The host name of an API that is deployed to the specified Region and intended to serve clients, such as EC2 instances, in the same AWS Region. API requests are targeted directly to the Region-specific API Gateway API without going through any CloudFront distribution. For in- Region requests, a Regional endpoint bypasses the unnecessary round trip to a CloudFront distribution. In addition, you can apply latency-based routing on Regional endpoints to deploy an API to multiple Regions using the same Regional API endpoint configuration, set the same custom domain name for each deployed API, and configure latency-based DNS records in Route 53 to route client requests to the Region that has the lowest latency. See API endpoints. Route A WebSocket |
apigateway-dg-008 | apigateway-dg.pdf | 8 | EC2 instances, in the same AWS Region. API requests are targeted directly to the Region-specific API Gateway API without going through any CloudFront distribution. For in- Region requests, a Regional endpoint bypasses the unnecessary round trip to a CloudFront distribution. In addition, you can apply latency-based routing on Regional endpoints to deploy an API to multiple Regions using the same Regional API endpoint configuration, set the same custom domain name for each deployed API, and configure latency-based DNS records in Route 53 to route client requests to the Region that has the lowest latency. See API endpoints. Route A WebSocket route in API Gateway is used to direct incoming messages to a specific integration, such as an AWS Lambda function, based on the content of the message. When you define your WebSocket API, you specify a route key and an integration backend. The route key is an attribute in the message body. When the route key is matched in an incoming message, the integration backend is invoked. A default route can also be set for non-matching route keys or to specify a proxy model that passes the message through as-is to backend components that perform the routing and process the request. Route request The public interface of a WebSocket API method in API Gateway that defines the body that an app developer must send in the requests to access the backend through the API. Route response The public interface of a WebSocket API that defines the status codes, headers, and body models that an app developer should expect from API Gateway. Usage plan A usage plan provides selected API clients with access to one or more deployed REST or WebSocket APIs. You can use a usage plan to configure throttling and quota limits, which are enforced on individual client API keys. API Gateway concepts 12 Amazon API Gateway WebSocket connection Developer Guide API Gateway maintains a persistent connection between clients and API Gateway itself. There is no persistent connection between API Gateway and backend integrations such as Lambda functions. Backend services are invoked as needed, based on the content of messages received from clients. Choose between REST APIs and HTTP APIs REST APIs and HTTP APIs are both RESTful API products. REST APIs support more features than HTTP APIs, while HTTP APIs are designed with minimal features so that they can be offered at a lower price. Choose REST APIs if you need features such as API keys, per-client throttling, request validation, AWS WAF integration, or private API endpoints. Choose HTTP APIs if you don't need the features included with REST APIs. The following sections summarize core features that are available in REST APIs and HTTP APIs. When necessary, additional links are provided to navigate between the REST API and HTTP API sections of the API Gateway Developer Guide. Endpoint type The endpoint type refers to the endpoint that API Gateway creates for your API. For more information, see the section called “API Gateway endpoint types”. Endpoint types REST API HTTP API Edge-optimized Regional Private Yes Yes Yes No Yes No Choose between REST APIs and HTTP APIs 13 Amazon API Gateway Security Developer Guide API Gateway provides a number of ways to protect your API from certain threats, like malicious actors or spikes in traffic. To learn more, see the section called “Protect” and the section called “Protect”. Security features REST API HTTP API Mutual TLS authentication Certificates for backend authentication AWS WAF Yes Yes Yes Authorization Yes No No API Gateway supports multiple mechanisms for controlling and managing access to your API. For more information, see the section called “Access control” and the section called “Access control”. Authorization options REST API HTTP API IAM Resource policies Amazon Cognito Custom authorization with an AWS Lambda function Yes Yes Yes Yes Yes No Yes 1 Yes Security 14 Amazon API Gateway Developer Guide Authorization options REST API HTTP API JSON Web Token (JWT) 2 No Yes 1 You can use Amazon Cognito with a JWT authorizer. 2 You can use a Lambda authorizer to validate JWTs for REST APIs. API management Choose REST APIs if you need API management capabilities such as API keys and per-client rate limiting. For more information, see the section called “Distribute”, the section called “Custom domain names”, and the section called “Custom domain names”. Features REST API HTTP API Custom domains API keys Per-client rate limiting Per-client usage throttling Yes Yes Yes Yes Development Yes No No No As you're developing your API Gateway API, you decide on a number of characteristics of your API. These characteristics depend on the use case of your API. For more information see the section called “Develop” and the section called “Develop”. API management 15 Amazon API Gateway Developer Guide Features REST API HTTP API CORS configuration Test invocations |
apigateway-dg-009 | apigateway-dg.pdf | 9 | information, see the section called “Distribute”, the section called “Custom domain names”, and the section called “Custom domain names”. Features REST API HTTP API Custom domains API keys Per-client rate limiting Per-client usage throttling Yes Yes Yes Yes Development Yes No No No As you're developing your API Gateway API, you decide on a number of characteristics of your API. These characteristics depend on the use case of your API. For more information see the section called “Develop” and the section called “Develop”. API management 15 Amazon API Gateway Developer Guide Features REST API HTTP API CORS configuration Test invocations Caching User-controlled deployments Automatic deployments Custom gateway responses Canary release deployments Request validation Request parameter transform ation Request body transformation Yes Yes Yes Yes No Yes Yes Yes Yes Yes Monitoring Yes No No Yes Yes No No No Yes No API Gateway supports several options to log API requests and monitor your APIs. For more information, see the section called “Monitor” and the section called “Monitor”. Monitoring 16 Amazon API Gateway Developer Guide Feature REST API HTTP API Amazon CloudWatch metrics Access logs to CloudWatch Logs Access logs to Amazon Data Firehose Execution logs AWS X-Ray tracing Yes Yes Yes Yes Yes Integrations Yes Yes No No No Integrations connect your API Gateway API to backend resources. For more information, see the section called “Integrations” and the section called “Integrations”. Feature REST API HTTP API Public HTTP endpoints AWS services AWS Lambda functions Private integrations with Network Load Balancers Private integrations with Application Load Balancers Yes Yes Yes Yes No Yes Yes Yes Yes Yes Integrations 17 Amazon API Gateway Developer Guide Feature REST API HTTP API Private integrations with AWS Cloud Map No Mock integrations Yes Yes No Get started with the REST API console In this getting started exercise, you create a serverless REST API using the API Gateway REST API console. Serverless APIs let you focus on your applications instead of spending your time provisioning and managing servers. This exercise should take less than 20 minutes to complete, and is possible within the AWS Free Tier. First, you create a Lambda function using the Lambda console. Next, you create a REST API using the API Gateway REST API console. Then, you create an API method and integrate it with a Lambda function using a Lambda proxy integration. Finally, you deploy and invoke your API. When you invoke your REST API, API Gateway routes the request to your Lambda function. Lambda runs the function and returns a response to API Gateway. API Gateway then returns that response to you. To complete this exercise, you need an AWS account and an AWS Identity and Access Management (IAM) user with console access. For more information, see Set up to use API Gateway. Topics • Step 1: Create a Lambda function • Step 2: Create a REST API • Step 3: Create a Lambda proxy integration Get started with the REST API console 18 Amazon API Gateway • Step 4: Deploy your API • Step 5: Invoke your API • (Optional) Step 6: Clean up Step 1: Create a Lambda function Developer Guide You use a Lambda function for the backend of your API. Lambda runs your code only when needed and scales automatically, from a few requests per day to thousands per second. For this exercise, you use a default Node.js function in the Lambda console. To create a Lambda function 1. Sign in to the Lambda console at https://console.aws.amazon.com/lambda. 2. Choose Create function. 3. Under Basic information, for Function name, enter my-function. 4. For all other options, use the default setting. 5. Choose Create function. The default Lambda function code should look similar to the following: export const handler = async (event) => { const response = { statusCode: 200, body: JSON.stringify('The API Gateway REST API console is great!'), }; return response; }; You can modify your Lambda function for this exercise, as long as the function's response aligns with the format that API Gateway requires. Replace the default response body (Hello from Lambda!) with The API Gateway REST API console is great!. When you invoke the example function, it returns a 200 response to clients, along with the updated response. Step 1: Create a Lambda function 19 Amazon API Gateway Developer Guide Step 2: Create a REST API Next, you create a REST API with a root resource (/). To create a REST API 1. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway. 2. Do one of the following: • • To create your first API, for REST API, choose Build. If you've created an API before, choose Create API, and then choose Build for REST API. 3. 4. For API name, enter my-rest-api. (Optional) For Description, enter a description. 5. Keep API endpoint type set |
apigateway-dg-010 | apigateway-dg.pdf | 10 | the updated response. Step 1: Create a Lambda function 19 Amazon API Gateway Developer Guide Step 2: Create a REST API Next, you create a REST API with a root resource (/). To create a REST API 1. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway. 2. Do one of the following: • • To create your first API, for REST API, choose Build. If you've created an API before, choose Create API, and then choose Build for REST API. 3. 4. For API name, enter my-rest-api. (Optional) For Description, enter a description. 5. Keep API endpoint type set to Regional. 6. For IP address type, select IPv4. 7. Choose Create API. Step 3: Create a Lambda proxy integration Next, you create an API method for your REST API on the root resource (/) and integrate the method with your Lambda function using a proxy integration. In a Lambda proxy integration, API Gateway passes the incoming request from the client directly to the Lambda function. To create a Lambda proxy integration 1. 2. 3. 4. 5. Select the / resource, and then choose Create method. For Method type, select ANY. For Integration type, select Lambda. Turn on Lambda proxy integration. For Lambda function, enter my-function, and then select your Lambda function. 6. Choose Create method. Step 4: Deploy your API Next, you create an API deployment and associate it with a stage. Step 2: Create a REST API 20 Amazon API Gateway To deploy your API 1. Choose Deploy API. 2. 3. 4. For Stage, select New stage. For Stage name, enter Prod. (Optional) For Description, enter a description. 5. Choose Deploy. Developer Guide Now clients can call your API. To test your API before deploying it, you can optionally choose the ANY method, navigate to the Test tab, and then choose Test. Step 5: Invoke your API To invoke your API 1. From the main navigation pane, choose Stage. 2. Under Stage details, choose the copy icon to copy your API's invoke URL. 3. Enter the invoke URL in a web browser. The full URL should look like https://abcd123.execute-api.us- east-2.amazonaws.com/Prod. Your browser sends a GET request to the API. Step 5: Invoke your API 21 Amazon API Gateway Developer Guide 4. Verify your API's response. You should see the text "The API Gateway REST API console is great!" in your browser. (Optional) Step 6: Clean up To prevent accruing unnecessary costs to your AWS account, delete the resources that you created as part of this exercise. The following steps delete your REST API, your Lambda function, and the associated resources. To delete your REST API 1. 2. In the Resources pane, choose API actions, Delete API. In the Delete API dialog box, enter confirm, and then choose Delete. To delete your Lambda function 1. Sign in to the Lambda console at https://console.aws.amazon.com/lambda. 2. On the Functions page, select your function. Choose Actions, Delete. 3. In the Delete 1 functions dialog box, enter delete, and then choose Delete. To delete your Lambda function's log group 1. Open the Log groups page of the Amazon CloudWatch console. 2. On the Log groups page, select your function's log group (/aws/lambda/my-function). Then, for Actions, choose Delete log group(s). 3. In the Delete log group(s) dialog box, choose Delete. To delete your Lambda function's execution role 1. Open the Roles page of the IAM console. 2. 3. 4. (Optional) On the Roles page, in the search box, enter my-function. Select your function's role (for example, my-function-31exxmpl), and then choose Delete. In the Delete my-function-31exxmpl? dialog box, enter the name of the role, and then choose Delete. (Optional) Step 6: Clean up 22 Amazon API Gateway Tip Developer Guide You can automate the creation and cleanup of AWS resources by using AWS CloudFormation or AWS Serverless Application Model (AWS SAM). For some example AWS CloudFormation templates, see the example templates for API Gateway in the awsdocs GitHub repository. (Optional) Step 6: Clean up 23 Amazon API Gateway Developer Guide Set up to use API Gateway Before you use Amazon API Gateway for the first time, complete the following tasks. Sign up for an AWS account If you do not have an AWS account, complete the following steps to create one. To sign up for an AWS account 1. Open https://portal.aws.amazon.com/billing/signup. 2. Follow the online instructions. Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad. When you sign up for an AWS account, an AWS account root user is created. The root user has access to all AWS services and resources in the account. As a security best practice, assign administrative access to a user, and use only the root user to perform tasks that require root user access. AWS sends you a confirmation email |
apigateway-dg-011 | apigateway-dg.pdf | 11 | the following steps to create one. To sign up for an AWS account 1. Open https://portal.aws.amazon.com/billing/signup. 2. Follow the online instructions. Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad. When you sign up for an AWS account, an AWS account root user is created. The root user has access to all AWS services and resources in the account. As a security best practice, assign administrative access to a user, and use only the root user to perform tasks that require root user access. AWS sends you a confirmation email after the sign-up process is complete. At any time, you can view your current account activity and manage your account by going to https://aws.amazon.com/ and choosing My Account. Create a user with administrative access After you sign up for an AWS account, secure your AWS account root user, enable AWS IAM Identity Center, and create an administrative user so that you don't use the root user for everyday tasks. Secure your AWS account root user 1. Sign in to the AWS Management Console as the account owner by choosing Root user and entering your AWS account email address. On the next page, enter your password. For help signing in by using root user, see Signing in as the root user in the AWS Sign-In User Guide. Sign up for an AWS account 24 Amazon API Gateway Developer Guide 2. Turn on multi-factor authentication (MFA) for your root user. For instructions, see Enable a virtual MFA device for your AWS account root user (console) in the IAM User Guide. Create a user with administrative access 1. Enable IAM Identity Center. For instructions, see Enabling AWS IAM Identity Center in the AWS IAM Identity Center User Guide. 2. In IAM Identity Center, grant administrative access to a user. For a tutorial about using the IAM Identity Center directory as your identity source, see Configure user access with the default IAM Identity Center directory in the AWS IAM Identity Center User Guide. Sign in as the user with administrative access • To sign in with your IAM Identity Center user, use the sign-in URL that was sent to your email address when you created the IAM Identity Center user. For help signing in using an IAM Identity Center user, see Signing in to the AWS access portal in the AWS Sign-In User Guide. Assign access to additional users 1. In IAM Identity Center, create a permission set that follows the best practice of applying least- privilege permissions. For instructions, see Create a permission set in the AWS IAM Identity Center User Guide. 2. Assign users to a group, and then assign single sign-on access to the group. For instructions, see Add groups in the AWS IAM Identity Center User Guide. Create a user with administrative access 25 Amazon API Gateway Developer Guide Get started with API Gateway In this getting started exercise, you create a serverless API. Serverless APIs let you focus on your applications, instead of spending time provisioning and managing servers. This exercise takes less than 20 minutes to complete, and is possible within the AWS Free Tier. First, you create a Lambda function using the AWS Lambda console. Next, you create an HTTP API using the API Gateway console. Then, you invoke your API. Note This exercise uses an HTTP API. API Gateway also supports REST APIs, which include more features. For a tutorial using a REST API, see the section called “Get started with the REST API console”. For more information about the difference between HTTP APIs and REST APIs, see the section called “Choose between REST APIs and HTTP APIs ”. When you invoke your HTTP API, API Gateway routes the request to your Lambda function. Lambda runs the Lambda function and returns a response to API Gateway. API Gateway then returns a response to you. To complete this exercise, you need an AWS account and an AWS Identity and Access Management user with console access. For more information, see Prerequisites. Topics • Step 1: Create a Lambda function • Step 2: Create an HTTP API • Step 3: Test your API • (Optional) Step 4: Clean up 26 Amazon API Gateway • Next steps Developer Guide Step 1: Create a Lambda function You use a Lambda function for the backend of your API. Lambda runs your code only when needed and scales automatically, from a few requests per day to thousands per second. For this example, you use the default Node.js function from the Lambda console. To create a Lambda function 1. Sign in to the Lambda console at https://console.aws.amazon.com/lambda. 2. Choose Create function. 3. 4. For Function name, enter my-function. For all other options, use the default setting. 5. Choose Create function. The example function returns |
apigateway-dg-012 | apigateway-dg.pdf | 12 | 26 Amazon API Gateway • Next steps Developer Guide Step 1: Create a Lambda function You use a Lambda function for the backend of your API. Lambda runs your code only when needed and scales automatically, from a few requests per day to thousands per second. For this example, you use the default Node.js function from the Lambda console. To create a Lambda function 1. Sign in to the Lambda console at https://console.aws.amazon.com/lambda. 2. Choose Create function. 3. 4. For Function name, enter my-function. For all other options, use the default setting. 5. Choose Create function. The example function returns a 200 response to clients, and the text Hello from Lambda!. You can modify your Lambda function, as long as the function's response aligns with the format that API Gateway requires. The default Lambda function code should look similar to the following: export const handler = async (event) => { const response = { statusCode: 200, body: JSON.stringify('Hello from Lambda!'), }; return response; }; Step 2: Create an HTTP API Next, you create an HTTP API. API Gateway also supports REST APIs and WebSocket APIs, but an HTTP API is the best choice for this exercise. REST APIs support more features than HTTP APIs, but we don't need those features for this exercise. HTTP APIs are designed with minimal features so Step 1: Create a Lambda function 27 Amazon API Gateway Developer Guide that they can be offered at a lower price. WebSocket APIs maintain persistent connections with clients for full-duplex communication, which isn't required for this example. The HTTP API provides an HTTP endpoint for your Lambda function. API Gateway routes requests to your Lambda function, and then returns the function's response to clients. To create an HTTP API 1. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway. 2. Do one of the following: • • To create your first API, for HTTP API, choose Build. If you've created an API before, choose Create API, and then choose Build for HTTP API. 3. For Integrations, choose Add integration. 4. Choose Lambda. 5. 6. For Lambda function, enter my-function. For API name, enter my-http-api. 7. Choose Next. 8. Review the route that API Gateway creates for you, and then choose Next. 9. Review the stage that API Gateway creates for you, and then choose Next. 10. Choose Create. Now you've created an HTTP API with a Lambda integration that's ready to receive requests from clients. Step 3: Test your API Next, you test your API to make sure that it's working. For simplicity, use a web browser to invoke your API. To test your API 1. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway. 2. Choose your API. 3. Note your API's invoke URL. Step 3: Test your API 28 Amazon API Gateway Developer Guide 4. Copy your API's invoke URL, and enter it in a web browser. Append the name of your Lambda function to your invoke URL to call your Lambda function. By default, the API Gateway console creates a route with the same name as your Lambda function, my-function. The full URL should look like https://abcdef123.execute-api.us- east-2.amazonaws.com/my-function. Your browser sends a GET request to the API. 5. Verify your API's response. You should see the text "Hello from Lambda!" in your browser. (Optional) Step 4: Clean up To prevent unnecessary costs, delete the resources that you created as part of this getting started exercise. The following steps delete your HTTP API, your Lambda function, and associated resources. To delete an HTTP API 1. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway. 2. On the APIs page, select an API. Choose Actions, and then choose Delete. 3. Choose Delete. (Optional) Step 4: Clean up 29 Amazon API Gateway To delete a Lambda function Developer Guide 1. Sign in to the Lambda console at https://console.aws.amazon.com/lambda. 2. On the Functions page, select a function. Choose Actions, and then choose Delete. 3. Choose Delete. To delete a Lambda function's log group 1. In the Amazon CloudWatch console, open the Log groups page. 2. On the Log groups page, select the function's log group (/aws/lambda/my-function). Choose Actions, and then choose Delete log group. 3. Choose Delete. To delete a Lambda function's execution role 1. 2. In the AWS Identity and Access Management console, open the Roles page. Select the function's role, for example, my-function-31exxmpl. 3. Choose Delete role. 4. Choose Yes, delete. You can automate the creation and cleanup of AWS resources by using AWS CloudFormation or AWS SAM. For example AWS CloudFormation templates, see example AWS CloudFormation templates. Next steps For this example, you used the AWS Management Console to create a simple HTTP API. The HTTP API invokes a Lambda function and returns a response to clients. The following are next steps as you continue to work |
apigateway-dg-013 | apigateway-dg.pdf | 13 | Lambda function's execution role 1. 2. In the AWS Identity and Access Management console, open the Roles page. Select the function's role, for example, my-function-31exxmpl. 3. Choose Delete role. 4. Choose Yes, delete. You can automate the creation and cleanup of AWS resources by using AWS CloudFormation or AWS SAM. For example AWS CloudFormation templates, see example AWS CloudFormation templates. Next steps For this example, you used the AWS Management Console to create a simple HTTP API. The HTTP API invokes a Lambda function and returns a response to clients. The following are next steps as you continue to work with API Gateway. • Configure additional types of API integrations, including: • HTTP endpoints • Private resources in a VPC, such as Amazon ECS services Next steps 30 Amazon API Gateway Developer Guide • AWS services such as Amazon Simple Queue Service, AWS Step Functions, and Kinesis Data Streams • Control access to your APIs • Enable logging for your APIs • Configure throttling for your APIs • Configure custom domains for your APIs To get help with Amazon API Gateway from the community, see the API Gateway Discussion Forum. When you enter this forum, AWS might require you to sign in. To get help with API Gateway directly from AWS, see the support options on the AWS Support page. See also our frequently asked questions (FAQs), or contact us directly. Next steps 31 Amazon API Gateway Developer Guide Amazon API Gateway tutorials and workshops The following tutorials and workshops provide hands-on exercises to help you learn about API Gateway. REST API tutorials • Choose an AWS Lambda integration tutorial • Tutorial: Create a REST API by importing an example • Choose an HTTP integration tutorial • Tutorial: Create a REST API with a private integration • Tutorial: Create a REST API with an AWS integration • Tutorial: Create a calculator REST API with two AWS service integrations and one Lambda non- proxy integration • Tutorial: Create a REST API as an Amazon S3 proxy • Tutorial: Create a REST API as an Amazon Kinesis proxy • Tutorial: Create a REST API using AWS SDKs or the AWS CLI • Tutorial: Create a private REST API HTTP API tutorials • Tutorial: Create a CRUD HTTP API with Lambda and DynamoDB • Tutorial: Create an HTTP API with a private integration to an Amazon ECS service WebSocket API tutorials • Tutorial: Create a WebSocket chat app with a WebSocket API, Lambda and DynamoDB Workshops • Build a serverless web application • CI/CD for serverless applications • Serverless security workshop • Serverless identity management, authentication and authorization 32 Amazon API Gateway Developer Guide • The Amazon API Gateway Workshop Amazon API Gateway REST API tutorials The following tutorials provide hands-on exercises to help you learn about API Gateway REST APIs. Topics • Choose an AWS Lambda integration tutorial • Tutorial: Create a REST API by importing an example • Choose an HTTP integration tutorial • Tutorial: Create a REST API with a private integration • Tutorial: Create a REST API with an AWS integration • Tutorial: Create a calculator REST API with two AWS service integrations and one Lambda non- proxy integration • Tutorial: Create a REST API as an Amazon S3 proxy • Tutorial: Create a REST API as an Amazon Kinesis proxy • Tutorial: Create a REST API using AWS SDKs or the AWS CLI • Tutorial: Create a private REST API Choose an AWS Lambda integration tutorial To build an API with Lambda integrations, you can use Lambda proxy integration or Lambda non- proxy integration. In Lambda proxy integration, the input to the Lambda function can be expressed as any combination of request headers, path variables, query string parameters, body, and API configuration data. You only need to choose a Lambda function. API Gateway configures the integration request and integration response for you. Once set up, your API method can evolve without modifying the existing settings. This is possible because the backend Lambda function parses the incoming request data and responds to the client. In Lambda non-proxy integration, you must ensure that input to the Lambda function is supplied as the integration request payload. You must map any input data the client supplied as request parameters into the proper integration request body. You might also need to translate the client- supplied request body into a format recognized by the Lambda function. REST API tutorials 33 Amazon API Gateway Developer Guide In either a Lambda proxy or a Lambda non-proxy integration, you can use a Lambda function in a different account from the account where you created your API. Topics • Tutorial: Create a REST API with a Lambda proxy integration • Tutorial: Create a REST API with a Lambda non-proxy integration • Tutorial: Create a REST API with a |
apigateway-dg-014 | apigateway-dg.pdf | 14 | data the client supplied as request parameters into the proper integration request body. You might also need to translate the client- supplied request body into a format recognized by the Lambda function. REST API tutorials 33 Amazon API Gateway Developer Guide In either a Lambda proxy or a Lambda non-proxy integration, you can use a Lambda function in a different account from the account where you created your API. Topics • Tutorial: Create a REST API with a Lambda proxy integration • Tutorial: Create a REST API with a Lambda non-proxy integration • Tutorial: Create a REST API with a cross-account Lambda proxy integration Tutorial: Create a REST API with a Lambda proxy integration Lambda proxy integration is a lightweight, flexible API Gateway API integration type that allows you to integrate an API method – or an entire API – with a Lambda function. The Lambda function can be written in any language that Lambda supports. Because it's a proxy integration, you can change the Lambda function implementation at any time without needing to redeploy your API. In this tutorial, you do the following: • Create a "Hello, World!" Lambda function to be the backend for the API. • Create and test a "Hello, World!" API with Lambda proxy integration. Topics • Create a "Hello, World!" Lambda function • Create a "Hello, World!" API • Deploy and test the API Create a "Hello, World!" Lambda function To create a "Hello, World!" Lambda function in the Lambda console 1. Sign in to the Lambda console at https://console.aws.amazon.com/lambda. 2. On the AWS navigation bar, choose an AWS Region. Note Note the region where you create the Lambda function. You'll need it when you create the API. Choose a Lambda integration tutorial 34 Amazon API Gateway Developer Guide 3. Choose Functions in the navigation pane. 4. Choose Create function. 5. Choose Author from scratch. 6. Under Basic information, do the following: a. b. c. In Function name, enter GetStartedLambdaProxyIntegration. For Runtime, choose either the latest supported Node.js or Python runtime. For Architecture, keep the default setting. d. Under Permissions, expand Change default execution role. For Execution role dropdown list, choose Create new role from AWS policy templates. In Role name, enter GetStartedLambdaBasicExecutionRole. Leave the Policy templates field blank. e. f. g. Choose Create function. 7. Under Function code, in the inline code editor, copy/paste the following code: Node.js export const handler = async(event, context) => { console.log('Received event:', JSON.stringify(event, null, 2)); var res ={ "statusCode": 200, "headers": { "Content-Type": "*/*" } }; var greeter = 'World'; if (event.greeter && event.greeter!=="") { greeter = event.greeter; } else if (event.body && event.body !== "") { var body = JSON.parse(event.body); if (body.greeter && body.greeter !== "") { greeter = body.greeter; } } else if (event.queryStringParameters && event.queryStringParameters.greeter && event.queryStringParameters.greeter !== "") { greeter = event.queryStringParameters.greeter; } else if (event.multiValueHeaders && event.multiValueHeaders.greeter && event.multiValueHeaders.greeter != "") { Choose a Lambda integration tutorial 35 Amazon API Gateway Developer Guide greeter = event.multiValueHeaders.greeter.join(" and "); } else if (event.headers && event.headers.greeter && event.headers.greeter ! = "") { greeter = event.headers.greeter; } res.body = "Hello, " + greeter + "!"; return res }; Python import json def lambda_handler(event, context): print(event) greeter = 'World' try: if (event['queryStringParameters']) and (event['queryStringParameters'] ['greeter']) and ( event['queryStringParameters']['greeter'] is not None): greeter = event['queryStringParameters']['greeter'] except KeyError: print('No greeter') try: if (event['multiValueHeaders']) and (event['multiValueHeaders'] ['greeter']) and ( event['multiValueHeaders']['greeter'] is not None): greeter = " and ".join(event['multiValueHeaders']['greeter']) except KeyError: print('No greeter') try: if (event['headers']) and (event['headers']['greeter']) and ( event['headers']['greeter'] is not None): greeter = event['headers']['greeter'] except KeyError: print('No greeter') if (event['body']) and (event['body'] is not None): Choose a Lambda integration tutorial 36 Amazon API Gateway Developer Guide body = json.loads(event['body']) try: if (body['greeter']) and (body['greeter'] is not None): greeter = body['greeter'] except KeyError: print('No greeter') res = { "statusCode": 200, "headers": { "Content-Type": "*/*" }, "body": "Hello, " + greeter + "!" } return res 8. Choose Deploy. Create a "Hello, World!" API Now create an API for your "Hello, World!" Lambda function by using the API Gateway console. To create a "Hello, World!" API 1. 2. 3. 4. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway. If this is your first time using API Gateway, you see a page that introduces you to the features of the service. Under REST API, choose Build. When the Create Example API popup appears, choose OK. If this is not your first time using API Gateway, choose Create API. Under REST API, choose Build. For API name, enter LambdaProxyAPI. (Optional) For Description, enter a description. 5. Keep API endpoint type set to Regional. 6. For IP address type, select IPv4. 7. Choose Create API. Choose a Lambda integration tutorial 37 Amazon API Gateway Developer Guide After you create an API, you create a resource. Typically, API resources are organized in |
apigateway-dg-015 | apigateway-dg.pdf | 15 | see a page that introduces you to the features of the service. Under REST API, choose Build. When the Create Example API popup appears, choose OK. If this is not your first time using API Gateway, choose Create API. Under REST API, choose Build. For API name, enter LambdaProxyAPI. (Optional) For Description, enter a description. 5. Keep API endpoint type set to Regional. 6. For IP address type, select IPv4. 7. Choose Create API. Choose a Lambda integration tutorial 37 Amazon API Gateway Developer Guide After you create an API, you create a resource. Typically, API resources are organized in a resource tree according to the application logic. For this example, you create a /helloworld resource. To create a resource 1. Choose Create resource. 2. Keep Proxy resource turned off. 3. Keep Resource path as /. 4. For Resource name, enter helloworld. 5. Keep CORS (Cross Origin Resource Sharing) turned off. 6. Choose Create resource. In a proxy integration, the entire request is sent to the backend Lambda function as-is, via a catch- all ANY method that represents any HTTP method. The actual HTTP method is specified by the client at run time. The ANY method allows you to use a single API method setup for all of the supported HTTP methods: DELETE, GET, HEAD, OPTIONS, PATCH, POST, and PUT. To create an ANY method 1. 2. 3. 4. 5. 6. Select the /helloworld resource, and then choose Create method. For Method type, select ANY. For Integration type, select Lambda function. Turn on Lambda proxy integration. For Lambda function, select the AWS Region where you created your Lambda function, and then enter the function name. To use the default timeout value of 29 seconds, keep Default timeout turned on. To set a custom timeout, choose Default timeout and enter a timeout value between 50 and 29000 milliseconds. 7. Choose Create method. Deploy and test the API To deploy your API 1. Choose Deploy API. Choose a Lambda integration tutorial 38 Amazon API Gateway Developer Guide 2. 3. 4. For Stage, select New stage. For Stage name, enter test. (Optional) For Description, enter a description. 5. Choose Deploy. 6. Under Stage details, choose the copy icon to copy your API's invoke URL. Use browser and cURL to test an API with Lambda proxy integration You can use a browser or cURL to test your API. To test GET requests using only query string parameters, you can enter the URL for the API's helloworld resource into a browser address bar. To create the URL for the API's helloworld resource, append the resource helloworld and the query string parameter ?greeter=John to your invoke URL. Your URL should look like the following. https://r275xc9bmd.execute-api.us-east-1.amazonaws.com/test/helloworld?greeter=John For other methods, you must use more advanced REST API testing utilities, such as POSTMAN or cURL. This tutorial uses cURL. The cURL command examples below assume that cURL is installed on your computer. To test your deployed API using cURL: 1. Open a terminal window. 2. Copy the following cURL command and paste it into the terminal window, and replace the invoke URL with the one you copied in the previous step and add /helloworld to the end of the URL. Note If you're running the command on Windows, use this syntax instead: curl -v -X POST "https://r275xc9bmd.execute-api.us-east-1.amazonaws.com/ test/helloworld" -H "content-type: application/json" -d "{ \"greeter\": \"John\" }" Choose a Lambda integration tutorial 39 Amazon API Gateway Developer Guide a. To call the API with the query string parameter of ?greeter=John: curl -X GET 'https://r275xc9bmd.execute-api.us-east-1.amazonaws.com/test/ helloworld?greeter=John' b. To call the API with a header parameter of greeter:John: curl -X GET https://r275xc9bmd.execute-api.us-east-1.amazonaws.com/test/ helloworld \ -H 'content-type: application/json' \ -H 'greeter: John' c. To call the API with a body of {"greeter":"John"}: curl -X POST https://r275xc9bmd.execute-api.us-east-1.amazonaws.com/test/ helloworld \ -H 'content-type: application/json' \ -d '{ "greeter": "John" }' In all the cases, the output is a 200 response with the following response body: Hello, John! Tutorial: Create a REST API with a Lambda non-proxy integration In this walkthrough, we use the API Gateway console to build an API that enables a client to call Lambda functions through the Lambda non-proxy integration (also known as custom integration). For more information about AWS Lambda and Lambda functions, see the AWS Lambda Developer Guide. To facilitate learning, we chose a simple Lambda function with minimal API setup to walk you through the steps of building an API Gateway API with the Lambda custom integration. When necessary, we describe some of the logic. For a more detailed example of the Lambda custom integration, see Tutorial: Create a calculator REST API with two AWS service integrations and one Lambda non-proxy integration. Choose a Lambda integration tutorial 40 Amazon API Gateway Developer Guide Before creating the API, set up the Lambda backend by creating a Lambda function in AWS Lambda, |
apigateway-dg-016 | apigateway-dg.pdf | 16 | functions, see the AWS Lambda Developer Guide. To facilitate learning, we chose a simple Lambda function with minimal API setup to walk you through the steps of building an API Gateway API with the Lambda custom integration. When necessary, we describe some of the logic. For a more detailed example of the Lambda custom integration, see Tutorial: Create a calculator REST API with two AWS service integrations and one Lambda non-proxy integration. Choose a Lambda integration tutorial 40 Amazon API Gateway Developer Guide Before creating the API, set up the Lambda backend by creating a Lambda function in AWS Lambda, described next. Topics • Create a Lambda function for Lambda non-proxy integration • Create an API with Lambda non-proxy integration • Test invoking the API method • Deploy the API • Test the API in a deployment stage • Clean up Create a Lambda function for Lambda non-proxy integration Note Creating Lambda functions may result in charges to your AWS account. In this step, you create a "Hello, World!"-like Lambda function for the Lambda custom integration. Throughout this walkthrough, the function is called GetStartedLambdaIntegration. The implementation of this GetStartedLambdaIntegration Lambda function is as follows: Node.js 'use strict'; var days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; var times = ['morning', 'afternoon', 'evening', 'night', 'day']; export const handler = async(event) => { console.log(event); // Parse the input for the name, city, time and day property values let name = event.name === null || event.name === undefined || event.name === "" ? 'you' : event.name; let city = event.city === undefined ? 'World' : event.city; let time = times.indexOf(event.time)<0 ? 'day' : event.time; let day = days.indexOf(event.day)<0 ? null : event.day; Choose a Lambda integration tutorial 41 Amazon API Gateway Developer Guide // Generate a greeting let greeting = 'Good ' + time + ', ' + name + ' of ' + city + '. '; if (day) greeting += 'Happy ' + day + '!'; // Log the greeting to CloudWatch console.log('Hello: ', greeting); // Return a greeting to the caller return {"greeting": greeting} }; Python import json days = { 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'} times = {'morning', 'afternoon', 'evening', 'night', 'day'} def lambda_handler(event, context): print(event) # parse the input for the name, city, time, and day property values name = event.get("name") or 'you' city = event.get("city") or 'World' try: if event['time'] in times: time = event['time'] else: time = 'day' except KeyError: time = 'day' try: if event['day'] in days: day = event['day'] else: day = '' Choose a Lambda integration tutorial 42 Amazon API Gateway Developer Guide except KeyError: day = '' # Generate a greeting greeting = 'Good ' + time + ', ' + name + ' of ' + \ city + '.' + ['', ' Happy ' + day + '!'][day != ''] # Log the greeting to CloudWatch print(greeting) # Return a greeting to the caller return {"greeting": greeting} For the Lambda custom integration, API Gateway passes the input to the Lambda function from the client as the integration request body. The event object of the Lambda function handler is the input. Our Lambda function is simple. It parses the input event object for the name, city, time, and day properties. It then returns a greeting, as a JSON object of {"message":greeting}, to the caller. The message is in the "Good [morning|afternoon|day], [name|you] in [city| World]. Happy day!" pattern. It is assumed that the input to the Lambda function is of the following JSON object: { "city": "...", "time": "...", "day": "...", "name" : "..." } For more information, see the AWS Lambda Developer Guide. In addition, the function logs its execution to Amazon CloudWatch by calling console.log(...). This is helpful for tracing calls when debugging the function. To allow the GetStartedLambdaIntegration function to log the call, set an IAM role with appropriate policies for the Lambda function to create the CloudWatch streams and add log entries to the streams. The Lambda console guides you through to create the required IAM roles and policies. If you set up the API without using the API Gateway console, such as when importing an API from an OpenAPI file, you must explicitly create, if necessary, and set up an invocation role and policy for API Gateway to invoke the Lambda functions. For more information on how to set up Lambda Choose a Lambda integration tutorial 43 Amazon API Gateway Developer Guide invocation and execution roles for an API Gateway API, see Control access to a REST API with IAM permissions. Compared to GetStartedLambdaProxyIntegration, the Lambda function for the Lambda proxy integration, the GetStartedLambdaIntegration Lambda function for the Lambda custom integration only takes input from the API Gateway API integration request body. The function can return an output of any JSON object, a |
apigateway-dg-017 | apigateway-dg.pdf | 17 | create, if necessary, and set up an invocation role and policy for API Gateway to invoke the Lambda functions. For more information on how to set up Lambda Choose a Lambda integration tutorial 43 Amazon API Gateway Developer Guide invocation and execution roles for an API Gateway API, see Control access to a REST API with IAM permissions. Compared to GetStartedLambdaProxyIntegration, the Lambda function for the Lambda proxy integration, the GetStartedLambdaIntegration Lambda function for the Lambda custom integration only takes input from the API Gateway API integration request body. The function can return an output of any JSON object, a string, a number, a Boolean, or even a binary blob. The Lambda function for the Lambda proxy integration, in contrast, can take the input from any request data, but must return an output of a particular JSON object. The GetStartedLambdaIntegration function for the Lambda custom integration can have the API request parameters as input, provided that API Gateway maps the required API request parameters to the integration request body before forwarding the client request to the backend. For this to happen, the API developer must create a mapping template and configure it on the API method when creating the API. Now, create the GetStartedLambdaIntegration Lambda function. To create the GetStartedLambdaIntegration Lambda function for Lambda custom integration 1. Open the AWS Lambda console at https://console.aws.amazon.com/lambda/. 2. Do one of the following: • If the welcome page appears, choose Get Started Now and then choose Create function. • If the Lambda > Functions list page appears, choose Create function. 3. Choose Author from scratch. 4. In the Author from scratch pane, do the following: a. b. c. For Name, enter GetStartedLambdaIntegration as the Lambda function name. For Runtime, choose either the latest supported Node.js or Python runtime. For Architecture, keep the default setting. d. Under Permissions, expand Change default execution role. For Execution role dropdown list, choose Create new role from AWS policy templates. e. For Role name, enter a name for your role (for example, GetStartedLambdaIntegrationRole). f. For Policy templates, choose Simple microservice permissions. g. Choose Create function. Choose a Lambda integration tutorial 44 Amazon API Gateway Developer Guide 5. In the Configure function pane, under Function code do the following: a. Copy the Lambda function code listed in the beginning of this section and paste it in the inline code editor. Leave the default choices for all other fields in this section. Choose Deploy. b. c. 6. To test the newly created function, choose the Test tab. a. b. For Event name, enter HelloWorldTest. For Event JSON, replace the default code with the following. { "name": "Jonny", "city": "Seattle", "time": "morning", "day": "Wednesday" } c. Choose Test to invoke the function. The Execution result: succeeded section is shown. Expand Details and you see the following output. { "greeting": "Good morning, Jonny of Seattle. Happy Wednesday!" } The output is also written to CloudWatch Logs. As a side exercise, you can use the IAM console to view the IAM role (GetStartedLambdaIntegrationRole) that was created as part of the Lambda function creation. Attached to this IAM role are two inline policies. One stipulates the most basic permissions for Lambda execution. It permits calling the CloudWatch CreateLogGroup for any CloudWatch resources of your account in the region where the Lambda function is created. This policy also allows creating the CloudWatch streams and logging events for the GetStartedLambdaIntegration Lambda function. { "Version": "2012-10-17", "Statement": [ Choose a Lambda integration tutorial 45 Amazon API Gateway { "Effect": "Allow", "Action": "logs:CreateLogGroup", "Resource": "arn:aws:logs:region:account-id:*" Developer Guide }, { "Effect": "Allow", "Action": [ "logs:CreateLogStream", "logs:PutLogEvents" ], "Resource": [ "arn:aws:logs:region:account-id:log-group:/aws/lambda/ GetStartedLambdaIntegration:*" ] } ] } The other policy document applies to invoking another AWS service that is not used in this example. You can skip it for now. Associated with the IAM role is a trusted entity, which is lambda.amazonaws.com. Here is the trust relationship: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "lambda.amazonaws.com" }, "Action": "sts:AssumeRole" } ] } The combination of this trust relationship and the inline policy makes it possible for the Lambda function to invoke a console.log() function to log events to CloudWatch Logs. Choose a Lambda integration tutorial 46 Amazon API Gateway Developer Guide Create an API with Lambda non-proxy integration With the Lambda function (GetStartedLambdaIntegration) created and tested, you are ready to expose the function through an API Gateway API. For illustration purposes, we expose the Lambda function with a generic HTTP method. We use the request body, a URL path variable, a query string, and a header to receive required input data from the client. We turn on the API Gateway request validator for the API to ensure that all of the required data is properly defined and specified. We configure a mapping template for API Gateway to transform |
apigateway-dg-018 | apigateway-dg.pdf | 18 | Gateway Developer Guide Create an API with Lambda non-proxy integration With the Lambda function (GetStartedLambdaIntegration) created and tested, you are ready to expose the function through an API Gateway API. For illustration purposes, we expose the Lambda function with a generic HTTP method. We use the request body, a URL path variable, a query string, and a header to receive required input data from the client. We turn on the API Gateway request validator for the API to ensure that all of the required data is properly defined and specified. We configure a mapping template for API Gateway to transform the client-supplied request data into the valid format as required by the backend Lambda function. To create an API with a Lambda non-proxy integration 1. 2. 3. 4. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway. If this is your first time using API Gateway, you see a page that introduces you to the features of the service. Under REST API, choose Build. When the Create Example API popup appears, choose OK. If this is not your first time using API Gateway, choose Create API. Under REST API, choose Build. For API name, enter LambdaNonProxyAPI. (Optional) For Description, enter a description. 5. Keep API endpoint type set to Regional. 6. For IP address type, select IPv4. 7. Choose Create API. After creating your API, you create a /{city} resource. This is an example of a resource with a path variable that takes an input from the client. Later, you map this path variable into the Lambda function input using a mapping template. To create a resource 1. Choose Create resource. 2. Keep Proxy resource turned off. 3. Keep Resource path as /. 4. For Resource name, enter {city}. 5. Keep CORS (Cross Origin Resource Sharing) turned off. Choose a Lambda integration tutorial 47 Amazon API Gateway 6. Choose Create resource. Developer Guide After creating your /{city} resource, you create an ANY method. The ANY HTTP verb is a placeholder for a valid HTTP method that a client submits at run time. This example shows that ANY method can be used for Lambda custom integration as well as for Lambda proxy integration. To create an ANY method 1. 2. 3. Select the /{city} resource, and then choose Create method. For Method type, select ANY. For Integration type, select Lambda function. 4. Keep Lambda proxy integration turned off. 5. For Lambda function, select the AWS Region where you created your Lambda function, and then enter the function name. 6. Choose Method request settings. Now, you turn on a request validator for a URL path variable, a query string parameter, and a header to ensure that all of the required data is defined. For this example, you create a time query string parameter and a day header. 7. For Request validator, select Validate query string parameters and headers. 8. Choose URL query string parameters and do the following: a. b. c. Choose Add query string. For Name, enter time. Turn on Required. d. Keep Caching turned off. 9. Choose HTTP request headers and do the following: a. b. c. Choose Add header. For Name, enter day. Turn on Required. d. Keep Caching turned off. 10. Choose Create method. Choose a Lambda integration tutorial 48 Amazon API Gateway Developer Guide After turning on a request validator, you configure the integration request for the ANY method by adding a body-mapping template to transform the incoming request into a JSON payload, as required by the backend Lambda function. To configure the integration request 1. On the Integration request tab, under the Integration request settings, choose Edit. 2. For Request body passthrough, select When there are no templates defined (recommended). 3. Choose Mapping templates. 4. Choose Add mapping template. 5. 6. For Content type, enter application/json. For Template body, enter the following code: #set($inputRoot = $input.path('$')) { "city": "$input.params('city')", "time": "$input.params('time')", "day": "$input.params('day')", "name": "$inputRoot.callerName" } 7. Choose Save. Test invoking the API method The API Gateway console provides a testing facility for you to test invoking the API before it is deployed. You use the Test feature of the console to test the API by submitting the following request: POST /Seattle?time=morning day:Wednesday { "callerName": "John" } In this test request, you'll set ANY to POST, set {city} to Seattle, assign Wednesday as the day header value, and assign "John" as the callerName value. Choose a Lambda integration tutorial 49 Amazon API Gateway To test the ANY method Developer Guide 1. Choose the Test tab. You might need to choose the right arrow button to show the tab. 2. 3. 4. 5. 6. For Method type, select POST. For Path, under city, enter Seattle. For Query strings, enter time=morning. For Headers, enter day:Wednesday. For Request Body, enter { "callerName": "John" }. 7. Choose Test. Verify that |
apigateway-dg-019 | apigateway-dg.pdf | 19 | } In this test request, you'll set ANY to POST, set {city} to Seattle, assign Wednesday as the day header value, and assign "John" as the callerName value. Choose a Lambda integration tutorial 49 Amazon API Gateway To test the ANY method Developer Guide 1. Choose the Test tab. You might need to choose the right arrow button to show the tab. 2. 3. 4. 5. 6. For Method type, select POST. For Path, under city, enter Seattle. For Query strings, enter time=morning. For Headers, enter day:Wednesday. For Request Body, enter { "callerName": "John" }. 7. Choose Test. Verify that the returned response payload is as follows: { "greeting": "Good morning, John of Seattle. Happy Wednesday!" } You can also view the logs to examine how API Gateway processes the request and response. Execution log for request test-request Thu Aug 31 01:07:25 UTC 2017 : Starting execution for request: test-invoke-request Thu Aug 31 01:07:25 UTC 2017 : HTTP Method: POST, Resource Path: /Seattle Thu Aug 31 01:07:25 UTC 2017 : Method request path: {city=Seattle} Thu Aug 31 01:07:25 UTC 2017 : Method request query string: {time=morning} Thu Aug 31 01:07:25 UTC 2017 : Method request headers: {day=Wednesday} Thu Aug 31 01:07:25 UTC 2017 : Method request body before transformations: { "callerName": "John" } Thu Aug 31 01:07:25 UTC 2017 : Request validation succeeded for content type application/json Thu Aug 31 01:07:25 UTC 2017 : Endpoint request URI: https:// lambda.us-west-2.amazonaws.com/2015-03-31/functions/arn:aws:lambda:us- west-2:123456789012:function:GetStartedLambdaIntegration/invocations Thu Aug 31 01:07:25 UTC 2017 : Endpoint request headers: {x-amzn-lambda-integration- tag=test-request, Authorization=****************************************************************************************************************************************************************************************************************************************************************************************************************************************338c72, X-Amz-Date=20170831T010725Z, x-amzn-apigateway-api-id=beags1mnid, X-Amz- Source-Arn=arn:aws:execute-api:us-west-2:123456789012:beags1mnid/null/POST/ {city}, Accept=application/json, User-Agent=AmazonAPIGateway_beags1mnid, X-Amz-Security-Token=FQoDYXdzELL//////////wEaDMHGzEdEOT/VvGhabiK3AzgKrJw +3zLqJZG4PhOq12K6W21+QotY2rrZyOzqhLoiuRg3CAYNQ2eqgL5D54+63ey9bIdtwHGoyBdq8ecWxJK/ Choose a Lambda integration tutorial 50 Amazon API Gateway Developer Guide YUnT2Rau0L9HCG5p7FC05h3IvwlFfvcidQNXeYvsKJTLXI05/ yEnY3ttIAnpNYLOezD9Es8rBfyruHfJfOqextKlsC8DymCcqlGkig8qLKcZ0hWJWVwiPJiFgL7laabXs+ +ZhCa4hdZo4iqlG729DE4gaV1mJVdoAagIUwLMo+y4NxFDu0r7I0/ EO5nYcCrppGVVBYiGk7H4T6sXuhTkbNNqVmXtV3ch5bOlh7 [TRUNCATED] Thu Aug 31 01:07:25 UTC 2017 : Endpoint request body after transformations: { "city": "Seattle", "time": "morning", "day": "Wednesday", "name" : "John" } Thu Aug 31 01:07:25 UTC 2017 : Sending request to https://lambda.us- west-2.amazonaws.com/2015-03-31/functions/arn:aws:lambda:us- west-2:123456789012:function:GetStartedLambdaIntegration/invocations Thu Aug 31 01:07:25 UTC 2017 : Received response. Integration latency: 328 ms Thu Aug 31 01:07:25 UTC 2017 : Endpoint response body before transformations: {"greeting":"Good morning, John of Seattle. Happy Wednesday!"} Thu Aug 31 01:07:25 UTC 2017 : Endpoint response headers: {x-amzn-Remapped-Content- Length=0, x-amzn-RequestId=c0475a28-8de8-11e7-8d3f-4183da788f0f, Connection=keep- alive, Content-Length=62, Date=Thu, 31 Aug 2017 01:07:25 GMT, X-Amzn-Trace- Id=root=1-59a7614d-373151b01b0713127e646635;sampled=0, Content-Type=application/json} Thu Aug 31 01:07:25 UTC 2017 : Method response body after transformations: {"greeting":"Good morning, John of Seattle. Happy Wednesday!"} Thu Aug 31 01:07:25 UTC 2017 : Method response headers: {X-Amzn-Trace- Id=sampled=0;root=1-59a7614d-373151b01b0713127e646635, Content-Type=application/json} Thu Aug 31 01:07:25 UTC 2017 : Successfully completed execution Thu Aug 31 01:07:25 UTC 2017 : Method completed with status: 200 The logs show the incoming request before the mapping and the integration request after the mapping. When a test fails, the logs are useful for evaluating whether the original input is correct or the mapping template works correctly. Deploy the API The test invocation is a simulation and has limitations. For example, it bypasses any authorization mechanism enacted on the API. To test the API execution in real time, you must deploy the API first. To deploy an API, you create a stage to create a snapshot of the API at that time. The stage name also defines the base path after the API's default host name. The API's root resource is appended after the stage name. When you modify the API, you must redeploy it to a new or existing stage before the changes take effect. Choose a Lambda integration tutorial 51 Developer Guide Amazon API Gateway To deploy the API to a stage 1. Choose Deploy API. 2. 3. For Stage, select New stage. For Stage name, enter test. Note The input must be UTF-8 encoded (i.e., unlocalized) text. 4. (Optional) For Description, enter a description. 5. Choose Deploy. Under Stage details, choose the copy icon to copy your API's invoke URL. The general pattern of the API's base URL is https://api-id.region.amazonaws.com/stageName. For example, the base URL of the API (beags1mnid) created in the us-west-2 region and deployed to the test stage is https://beags1mnid.execute-api.us-west-2.amazonaws.com/test. Test the API in a deployment stage There are several ways you can test a deployed API. For GET requests using only URL path variables or query string parameters, you can enter the API resource URL in a browser. For other methods, you must use more advanced REST API testing utilities, such as POSTMAN or cURL. To test the API using cURL 1. Open a terminal window on your local computer connected to the internet. 2. To test POST /Seattle?time=evening: Copy the following cURL command and paste it into the terminal window. curl -v -X POST \ 'https://beags1mnid.execute-api.us-west-2.amazonaws.com/test/Seattle? time=evening' \ -H 'content-type: application/json' \ -H 'day: Thursday' \ -H 'x-amz-docs-region: us-west-2' \ -d '{ "callerName": "John" Choose a Lambda integration tutorial 52 Amazon API Gateway }' Developer Guide You should get a successful response with the following payload: {"greeting":"Good |
apigateway-dg-020 | apigateway-dg.pdf | 20 | For other methods, you must use more advanced REST API testing utilities, such as POSTMAN or cURL. To test the API using cURL 1. Open a terminal window on your local computer connected to the internet. 2. To test POST /Seattle?time=evening: Copy the following cURL command and paste it into the terminal window. curl -v -X POST \ 'https://beags1mnid.execute-api.us-west-2.amazonaws.com/test/Seattle? time=evening' \ -H 'content-type: application/json' \ -H 'day: Thursday' \ -H 'x-amz-docs-region: us-west-2' \ -d '{ "callerName": "John" Choose a Lambda integration tutorial 52 Amazon API Gateway }' Developer Guide You should get a successful response with the following payload: {"greeting":"Good evening, John of Seattle. Happy Thursday!"} If you change POST to PUT in this method request, you get the same response. Clean up If you no longer need the Lambda functions you created for this walkthrough, you can delete them now. You can also delete the accompanying IAM resources. Warning If you plan to complete the other walkthroughs in this series, do not delete the Lambda execution role or the Lambda invocation role. If you delete a Lambda function that your APIs rely on, those APIs will no longer work. Deleting a Lambda function cannot be undone. If you want to use the Lambda function again, you must re-create the function. If you delete an IAM resource that a Lambda function relies on, that Lambda function will no longer work, and any APIs that rely on that function will no longer work. Deleting an IAM resource cannot be undone. If you want to use the IAM resource again, you must re- create the resource. To delete the Lambda function 1. Sign in to the AWS Management Console and open the AWS Lambda console at https:// console.aws.amazon.com/lambda/. 2. From the list of functions, choose GetStartedLambdaIntegration, choose Actions, and then choose Delete function. When prompted, choose Delete again. To delete the associated IAM resources 1. Open the IAM console at https://console.aws.amazon.com/iam/. 2. From Details, choose Roles. Choose a Lambda integration tutorial 53 Amazon API Gateway Developer Guide 3. From the list of roles, choose GetStartedLambdaIntegrationRole, choose Role Actions, and then choose Delete Role. Follow the steps in the console to delete the role. Tutorial: Create a REST API with a cross-account Lambda proxy integration You can now use an AWS Lambda function from a different AWS account as your API integration backend. Each account can be in any region where Amazon API Gateway is available. This makes it easy to centrally manage and share Lambda backend functions across multiple APIs. In this section, we show how to configure cross-account Lambda proxy integration using the Amazon API Gateway console. Create API for API Gateway cross-account Lambda integration To create an API 1. 2. 3. 4. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway. If this is your first time using API Gateway, you see a page that introduces you to the features of the service. Under REST API, choose Build. When the Create Example API popup appears, choose OK. If this is not your first time using API Gateway, choose Create API. Under REST API, choose Build. For API name, enter CrossAccountLambdaAPI. (Optional) For Description, enter a description. 5. Keep API endpoint type set to Regional. 6. For IP address type, select IPv4. 7. Choose Create API. Create Lambda integration function in another account Now you'll create a Lambda function in a different account from the one in which you created the example API. Creating a Lambda function in another account 1. Log in to the Lambda console in a different account from the one where you created your API Gateway API. Choose a Lambda integration tutorial 54 Amazon API Gateway Developer Guide 2. Choose Create function. 3. Choose Author from scratch. 4. Under Author from scratch, do the following: a. b. c. For Function name, enter a name. From the Runtime drop-down list, choose a supported Node.js runtime. For Architecture, keep the default setting. d. Under Permissions, expand Choose or create an execution role. You can create a role or choose an existing role. e. Choose Create function to continue. Scroll down to the Function code pane. Enter the Node.js function implementation from the section called “Tutorial: Create a REST API with a Lambda proxy integration”. 5. 6. 7. Choose Deploy. 8. Note the full ARN for your function (in the upper right corner of the Lambda function pane). You'll need it when you create your cross-account Lambda integration. Configure cross-account Lambda integration Once you have a Lambda integration function in a different account, you can use the API Gateway console to add it to your API in your first account. Note If you are configuring a cross-region, cross-account authorizer, the sourceArn that is added to the target function should use the region of the function, not the region of the |
apigateway-dg-021 | apigateway-dg.pdf | 21 | with a Lambda proxy integration”. 5. 6. 7. Choose Deploy. 8. Note the full ARN for your function (in the upper right corner of the Lambda function pane). You'll need it when you create your cross-account Lambda integration. Configure cross-account Lambda integration Once you have a Lambda integration function in a different account, you can use the API Gateway console to add it to your API in your first account. Note If you are configuring a cross-region, cross-account authorizer, the sourceArn that is added to the target function should use the region of the function, not the region of the API. After you create an API, you create a resource. Typically, API resources are organized in a resource tree according to the application logic. For this example, you create a /helloworld resource. To create a resource 1. Choose Create resource. 2. Keep Proxy resource turned off. Choose a Lambda integration tutorial 55 Amazon API Gateway 3. Keep Resource path as /. 4. For Resource name, enter helloworld. 5. Keep CORS (Cross Origin Resource Sharing) turned off. 6. Choose Create resource. Developer Guide After you create an resource, you create a GET method. You integrate the GET method with a Lambda function in another account. To create a GET method 1. 2. 3. 4. 5. Select the /helloworld resource, and then choose Create method. For Method type, select GET. For Integration type, select Lambda function. Turn on Lambda proxy integration. For Lambda function, enter the full ARN of your Lambda function from Step 1. In the Lambda console, you can find the ARN for your function in the upper right corner of the console window. 6. When you enter the ARN, a aws lambda add-permission command string will appear. This policy grants your first account access to your second account's Lambda function. Copy and paste the aws lambda add-permission command string into an AWS CLI window that is configured for your second account. 7. Choose Create method. You can see your updated policy for your function in the Lambda console. (Optional) To see your updated policy 1. Sign in to the AWS Management Console and open the AWS Lambda console at https:// console.aws.amazon.com/lambda/. 2. Choose your Lambda function. 3. Choose Permissions. You should see an Allow policy with a Condition clause in which the in the AWS:SourceArn is the ARN for your API's GET method. Choose a Lambda integration tutorial 56 Amazon API Gateway Developer Guide Tutorial: Create a REST API by importing an example You can use the Amazon API Gateway console to create and test a simple REST API with the HTTP integration for a PetStore website. The API definition is preconfigured as a OpenAPI 2.0 file. After loading the API definition into API Gateway, you can use the API Gateway console to examine the API's basic structure or simply deploy and test the API. The PetStore example API supports the following methods for a client to access the HTTP backend website of http://petstore-demo-endpoint.execute-api.com/petstore/pets. Note This tutorial uses an HTTP endpoint as an example. When you create your own APIs, we recommend you use HTTPS endpoints for your HTTP integrations. • GET /: for read access of the API's root resource that is not integrated with any backend endpoint. API Gateway responds with an overview of the PetStore website. This is an example of the MOCK integration type. • GET /pets: for read access to the API's /pets resource that is integrated with the like-named backend /pets resource. The backend returns a page of available pets in the PetStore. This is an example of the HTTP integration type. The URL of the integration endpoint is http:// petstore-demo-endpoint.execute-api.com/petstore/pets. • POST /pets: for write access to the API's /pets resource that is integrated with the backend / petstore/pets resource. Upon receiving a correct request, the backend adds the specified pet to the PetStore and returns the result to the caller. The integration is also HTTP. • GET /pets/{petId}: for read access to a pet as identified by a petId value as specified as a path variable of the incoming request URL. This method also has the HTTP integration type. The backend returns the specified pet found in the PetStore. The URL of the backend HTTP endpoint is http://petstore-demo-endpoint.execute-api.com/petstore/pets/n, where n is an integer as the identifier of the queried pet. The API supports CORS access via the OPTIONS methods of the MOCK integration type. API Gateway returns the required headers supporting CORS access. The following procedure walks you through the steps to create and test an API from an example using the API Gateway Console. Tutorial: Create a REST API by importing an example 57 Amazon API Gateway Developer Guide To import, build, and test the example API 1. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway. 2. Do one |
apigateway-dg-022 | apigateway-dg.pdf | 22 | of the backend HTTP endpoint is http://petstore-demo-endpoint.execute-api.com/petstore/pets/n, where n is an integer as the identifier of the queried pet. The API supports CORS access via the OPTIONS methods of the MOCK integration type. API Gateway returns the required headers supporting CORS access. The following procedure walks you through the steps to create and test an API from an example using the API Gateway Console. Tutorial: Create a REST API by importing an example 57 Amazon API Gateway Developer Guide To import, build, and test the example API 1. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway. 2. Do one of the following: • • To create your first API, for REST API, choose Build. If you've created an API before, choose Create API, and then choose Build for REST API. 3. Under Create REST API, choose Example API and then choose Create API to create the example API. You can scroll down the OpenAPI definition for details of this example API before choosing Create API. 4. In the main navigation pane, choose Resources. The newly created API is shown as follows: Tutorial: Create a REST API by importing an example 58 Amazon API Gateway Developer Guide The Resources pane shows the structure of the created API as a tree of nodes. API methods defined on each resource are edges of the tree. When a resource is selected, all of its methods are listed in the Methods table on the right. Displayed with each method is the method type, integration type, authorization type, and API key requirement. 5. To view the details of a method, to modify its set-up, or to test the method invocation, choose the method name from either the method list or the resource tree. Here, we choose the POST /pets method as an illustration: Tutorial: Create a REST API by importing an example 59 Amazon API Gateway Developer Guide The resulting Method execution pane presents a logical view of the chosen (POST /pets) method's structure and behaviors. The Method request and Method response represent the API's interface with the frontend, and the Integration request and Integration response represent the API's interface with the backend. A client uses the API to access a backend feature through the Method request. API Gateway translates the client request, if necessary, into the form acceptable to the backend in Integration request before forwarding the incoming request to the backend. The transformed request is known as the integration request. Similarly, the backend returns the response to API Gateway in Integration response. API Gateway then routes it to Method Response before sending it to the client. Again, if necessary, API Gateway can map the backend response data to a form expected by the client. Tutorial: Create a REST API by importing an example 60 Amazon API Gateway Developer Guide For the POST method on an API resource, the method request payload can be passed through to the integration request without modification, if the method request's payload is of the same format as the integration request's payload. The GET / method request uses the MOCK integration type and is not tied to any real backend endpoint. The corresponding Integration response is set up to return a static HTML page. When the method is called, the API Gateway simply accepts the request and immediately returns the configured integration response to the client by way of Method response. You can use the mock integration to test an API without requiring a backend endpoint. You can also use it to serve a local response, generated from a response body-mapping template. As an API developer, you control the behaviors of your API's frontend interactions by configuring the method request and a method response. You control the behaviors of your API's backend interactions by setting up the integration request and integration response. These involve data mappings between a method and its corresponding integration. For now, we focus on testing the API to provide an end-to-end user experience. 6. 7. Select the Test tab. You might need to choose the right arrow button to show the tab. For example, to test the POST /pets method, enter the following {"type": "dog","price": 249.99} payload into the Request body, and then choose Test. Tutorial: Create a REST API by importing an example 61 Amazon API Gateway Developer Guide The input specifies the attributes of the pet that we want to add to the list of pets on the PetStore website. 8. The results display as follows: Tutorial: Create a REST API by importing an example 62 Amazon API Gateway Developer Guide The Log entry of the output shows the state changes from the method request to the integration request, and from the integration response to the method response. This can be useful for troubleshooting any mapping errors that cause the request to fail. |
apigateway-dg-023 | apigateway-dg.pdf | 23 | Tutorial: Create a REST API by importing an example 61 Amazon API Gateway Developer Guide The input specifies the attributes of the pet that we want to add to the list of pets on the PetStore website. 8. The results display as follows: Tutorial: Create a REST API by importing an example 62 Amazon API Gateway Developer Guide The Log entry of the output shows the state changes from the method request to the integration request, and from the integration response to the method response. This can be useful for troubleshooting any mapping errors that cause the request to fail. In this example, no mapping is applied: the method request payload is passed through the integration request to the backend and, similarly, the backend response is passed through the integration response to the method response. To test the API using a client other than the API Gateway test-invoke-request feature, you must first deploy the API to a stage. 9. To deploy the sample API, choose Deploy API. Tutorial: Create a REST API by importing an example 63 Amazon API Gateway Developer Guide 10. For Stage, select New stage, and then enter test. 11. (Optional) For Description, enter a description. 12. Choose Deploy. 13. In the resulting Stages pane, under Stage details, the Invoke URL displays the URL to invoke the API's GET / method request. Tutorial: Create a REST API by importing an example 64 Amazon API Gateway Developer Guide 14. Choose the copy icon to copy your API's invoke URL, and then enter your API's invoke URL in a web browser. A successful response return the result, generated from the mapping template in the integration response. 15. In the Stages navigation pane, expand the test stage, select GET on /pets/ {petId}, and then copy the Invoke URL value of https://api-id.execute- api.region.amazonaws.com/test/pets/{petId}. {petId} stands for a path variable. Paste the Invoke URL value (obtained in the previous step) into the address bar of a browser, replacing {petId} by, for example, 1, and press Enter to submit the request. A 200 OK response should return with the following JSON payload: { "id": 1, "type": "dog", "price": 249.99 } Invoking the API method as shown is possible because its Authorization type is set to NONE. If the AWS_IAM authorization were used, you would sign the request using the Signature Version 4 (SigV4) protocols. For an example of such a request, see the section called “Tutorial: Create a REST API with an HTTP non-proxy integration”. Tutorial: Create a REST API by importing an example 65 Amazon API Gateway Developer Guide Choose an HTTP integration tutorial To build an API with HTTP integration, you can use either an HTTP proxy integration or an HTTP custom integration. In an HTTP proxy integration, you only need to set the HTTP method and the HTTP endpoint URI, according to the backend requirements. We recommend that you use the HTTP proxy integration, whenever possible, to take advantage of the streamlined API set up. You might want to use an HTTP custom integration if you need to transform client request data for the backend or transform the backend response data for the client. Topics • Tutorial: Create a REST API with an HTTP proxy integration • Tutorial: Create a REST API with an HTTP non-proxy integration Tutorial: Create a REST API with an HTTP proxy integration HTTP proxy integration is a simple, powerful, and versatile mechanism to build an API that allows a web application to access multiple resources or features of the integrated HTTP endpoint, for example the entire website, with a streamlined setup of a single API method. In HTTP proxy integration, API Gateway passes the client-submitted method request to the backend. The request data that is passed through includes the request headers, query string parameters, URL path variables, and payload. The backend HTTP endpoint or the web server parses the incoming request data to determine the response that it returns. HTTP proxy integration makes the client and backend interact directly with no intervention from API Gateway after the API method is set up, except for known issues such as unsupported characters, which are listed in the section called “Important notes”. With the all-encompassing proxy resource {proxy+}, and the catch-all ANY verb for the HTTP method, you can use an HTTP proxy integration to create an API of a single API method. The method exposes the entire set of the publicly accessible HTTP resources and operations of a website. When the backend web server opens more resources for public access, the client can use these new resources with the same API setup. To enable this, the website developer must communicate clearly to the client developer what the new resources are and what operations are applicable for each of them. Choose an HTTP integration tutorial 66 Amazon API |
apigateway-dg-024 | apigateway-dg.pdf | 24 | and the catch-all ANY verb for the HTTP method, you can use an HTTP proxy integration to create an API of a single API method. The method exposes the entire set of the publicly accessible HTTP resources and operations of a website. When the backend web server opens more resources for public access, the client can use these new resources with the same API setup. To enable this, the website developer must communicate clearly to the client developer what the new resources are and what operations are applicable for each of them. Choose an HTTP integration tutorial 66 Amazon API Gateway Developer Guide As a quick introduction, the following tutorial demonstrates the HTTP proxy integration. In the tutorial, we create an API using the API Gateway console to integrate with the PetStore website through a generic proxy resource {proxy+}, and create the HTTP method placeholder of ANY. Topics • Create an API with HTTP proxy integration using the API Gateway console • Test an API with HTTP proxy integration Create an API with HTTP proxy integration using the API Gateway console The following procedure walks you through the steps to create and test an API with a proxy resource for an HTTP backend using the API Gateway console. The HTTP backend is the PetStore website (http://petstore-demo-endpoint.execute-api.com/petstore/pets) from Tutorial: Create a REST API with an HTTP non-proxy integration, in which screenshots are used as visual aids to illustrate the API Gateway UI elements. If you are new to using the API Gateway console to create an API, you may want to follow that section first. To create an API 1. 2. 3. 4. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway. If this is your first time using API Gateway, you see a page that introduces you to the features of the service. Under REST API, choose Build. When the Create Example API popup appears, choose OK. If this is not your first time using API Gateway, choose Create API. Under REST API, choose Build. For API name, enter HTTPProxyAPI. (Optional) For Description, enter a description. 5. Keep API endpoint type set to Regional. 6. For IP address type, select IPv4. 7. Choose Create API. In this step, you create a proxy resource path of {proxy+}. This is the placeholder of any of the backend endpoints under http://petstore-demo-endpoint.execute-api.com/. For example, it can be petstore, petstore/pets, and petstore/pets/{petId}. API Gateway Choose an HTTP integration tutorial 67 Amazon API Gateway Developer Guide creates the ANY method when you create the {proxy+} resource and serves as a placeholder for any of the supported HTTP verbs at run time. To create a /{proxy+} resource 1. Choose your API. 2. In the main navigation pane, choose Resources. 3. Choose Create resource. 4. Turn on Proxy resource. 5. Keep Resource path as /. 6. For Resource name, enter {proxy+}. 7. Keep CORS (Cross Origin Resource Sharing) turned off. 8. Choose Create resource. In this step, you integrate the ANY method with a backend HTTP endpoint, using a proxy integration. In a proxy integration, API Gateway passes the client-submitted method request to the backend with no intervention from API Gateway. Choose an HTTP integration tutorial 68 Amazon API Gateway To create an ANY method 1. Choose the /{proxy+} resource. 2. Choose the ANY method. Developer Guide 3. Under the warning symbol, choose Edit integration. You cannot deploy an API that has a 4. 5. 6. 7. method without an integration. For Integration type, select HTTP. Turn on HTTP proxy integration. For HTTP method, select ANY. For Endpoint URL, enter http://petstore-demo-endpoint.execute-api.com/ {proxy}. 8. Choose Save. Test an API with HTTP proxy integration Whether a particular client request succeeds depends on the following: • If the backend has made the corresponding backend endpoint available and, if so, has granted the required access permissions. • If the client supplies the correct input. For example, the PetStore API used here does not expose the /petstore resource. As such, you get a 404 Resource Not Found response containing the error message of Cannot GET / petstore. In addition, the client must be able to handle the output format of the backend in order to parse the result correctly. API Gateway does not mediate to facilitate interactions between the client and backend. To test an API integrated with the PetStore website using HTTP proxy integration through the proxy resource 1. 2. 3. Select the Test tab. You might need to choose the right arrow button to show the tab. For Method type, select GET. For Path, under proxy, enter petstore/pets. Choose an HTTP integration tutorial 69 Amazon API Gateway Developer Guide 4. For Query strings, enter type=fish. 5. Choose Test. Because the backend website supports the GET /petstore/pets?type=fish request, it returns a successful response similar to the following: [ { "id": 1, "type": |
apigateway-dg-025 | apigateway-dg.pdf | 25 | mediate to facilitate interactions between the client and backend. To test an API integrated with the PetStore website using HTTP proxy integration through the proxy resource 1. 2. 3. Select the Test tab. You might need to choose the right arrow button to show the tab. For Method type, select GET. For Path, under proxy, enter petstore/pets. Choose an HTTP integration tutorial 69 Amazon API Gateway Developer Guide 4. For Query strings, enter type=fish. 5. Choose Test. Because the backend website supports the GET /petstore/pets?type=fish request, it returns a successful response similar to the following: [ { "id": 1, "type": "fish", "price": 249.99 }, { "id": 2, "type": "fish", "price": 124.99 }, { "id": 3, "type": "fish", "price": 0.99 } Choose an HTTP integration tutorial 70 Amazon API Gateway ] Developer Guide If you try to call GET /petstore, you get a 404 response with an error message of Cannot GET /petstore. This is because the backend does not support the specified operation. If you call GET /petstore/pets/1, you get a 200 OK response with the following payload, because the request is supported by the PetStore website. { "id": 1, "type": "dog", "price": 249.99 } You can also use a browser to test your API. Deploy your API and associate it to a stage to create your API's Invoke URL. To deploy your API 1. Choose Deploy API. 2. 3. 4. For Stage, select New stage. For Stage name, enter test. (Optional) For Description, enter a description. 5. Choose Deploy. Now clients can call your API. To invoke your API 1. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway. 2. Choose your API. 3. In the main navigation pane, choose Stage. 4. Under Stage details, choose the copy icon to copy your API's invoke URL. Enter your API's invoke URL in a web browser. The full URL should look like https://abcdef123.execute-api.us- east-2.amazonaws.com/test/petstore/pets?type=fish. Choose an HTTP integration tutorial 71 Amazon API Gateway Developer Guide Your browser sends a GET request to the API. 5. The result should be the same as returned when you use Test in the API Gateway console. Tutorial: Create a REST API with an HTTP non-proxy integration In this tutorial, you create an API from scratch using the Amazon API Gateway console. You can think of the console as an API design studio and use it to scope the API features, to experiment with its behaviors, to build the API, and to deploy your API in stages. Topics • Create an API with HTTP custom integration • (Optional) Map request parameters Create an API with HTTP custom integration This section walks you through the steps to create resources, expose methods on a resource, configure a method to achieve the desired API behaviors, and to test and deploy the API. In this step, you create an empty API. In the following steps you create resources and methods to connect your API to the http://petstore-demo-endpoint.execute-api.com/petstore/ pets endpoint, using a non-proxy HTTP integration. To create an API 1. 2. 3. 4. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway. If this is your first time using API Gateway, you see a page that introduces you to the features of the service. Under REST API, choose Build. When the Create Example API popup appears, choose OK. If this is not your first time using API Gateway, choose Create API. Under REST API, choose Build. For API name, enter HTTPNonProxyAPI. (Optional) For Description, enter a description. 5. Keep API endpoint type set to Regional. 6. For IP address type, select IPv4. 7. Choose Create API. Choose an HTTP integration tutorial 72 Amazon API Gateway Developer Guide The Resources tree shows the root resource (/) without any methods. In this exercise, we will build the API with the HTTP custom integration of the PetStore website (http://petstore-demo- endpoint.execute-api.com/petstore/pets.) For illustration purposes, we will create a /pets resource as a child of the root and expose a GET method on this resource for a client to retrieve a list of available Pets items from the PetStore website. To create a /pets resource 1. Choose Create resource. 2. Keep Proxy resource turned off. 3. Keep Resource path as /. 4. For Resource name, enter pets. 5. Keep CORS (Cross Origin Resource Sharing) turned off. 6. Choose Create resource. In this step, you create a GET method on the /pets resource. The GET method is integrated with the http://petstore-demo-endpoint.execute-api.com/petstore/pets website. Other options for an API method include the following: • POST, primarily used to create child resources. • PUT, primarily used to update existing resources (and, although not recommended, can be used to create child resources). • DELETE, used to delete resources. • PATCH, used to update resources. • HEAD, primarily used in testing scenarios. It is the same as GET but does not return |
apigateway-dg-026 | apigateway-dg.pdf | 26 | pets. 5. Keep CORS (Cross Origin Resource Sharing) turned off. 6. Choose Create resource. In this step, you create a GET method on the /pets resource. The GET method is integrated with the http://petstore-demo-endpoint.execute-api.com/petstore/pets website. Other options for an API method include the following: • POST, primarily used to create child resources. • PUT, primarily used to update existing resources (and, although not recommended, can be used to create child resources). • DELETE, used to delete resources. • PATCH, used to update resources. • HEAD, primarily used in testing scenarios. It is the same as GET but does not return the resource representation. • OPTIONS, which can be used by callers to get information about available communication options for the target service. For the integration request's HTTP method, you must choose one supported by the backend. For HTTP or Mock integration, it makes sense that the method request and the integration request use the same HTTP verb. For other integration types the method request will likely use an HTTP verb different from the integration request. For example, to call a Lambda function, the integration request must use POST to invoke the function, whereas the method request may use any HTTP verb depending on the logic of the Lambda function. Choose an HTTP integration tutorial 73 Amazon API Gateway Developer Guide To create a GET method on the /pets resource 1. Select the /pets resource. 2. Choose Create method. 3. 4. For Method type, select GET. For Integration type, select HTTP integration. 5. Keep HTTP proxy integration turned off. 6. 7. For HTTP method, select GET. For Endpoint URL, enter http://petstore-demo-endpoint.execute-api.com/ petstore/pets. The PetStore website allows you to retrieve a list of Pet items by the pet type, such as "Dog" or "Cat", on a given page. 8. For Content handling, select Passthrough. 9. Choose URL query string parameters. The PetStore website uses the type and page query string parameters to accept an input. You add query string parameters to the method request and map them into corresponding query string parameters of the integration request. 10. To add the query string parameters, do the following: a. b. c. Choose Add query string. For Name, enter type Keep Required and Caching turned off. Repeat the previous steps to create an additional query string with the name page. 11. Choose Create method. The client can now supply a pet type and a page number as query string parameters when submitting a request. These input parameters must be mapped into the integration's query string parameters to forward the input values to our PetStore website in the backend. To map input parameters to the Integration request 1. On the Integration request tab, under Integration request settings, choose Edit. Choose an HTTP integration tutorial 74 Amazon API Gateway Developer Guide 2. Choose URL query string parameters, and then do the following: a. b. c. Choose Add query string parameter. For Name, enter type. For Mapped from, enter method.request.querystring.type d. Keep Caching turned off. e. f. g. Choose Add query string parameter. For Name, enter page. For Mapped from, enter method.request.querystring.page h. Keep Caching turned off. 3. Choose Save. To test the API 1. Choose the Test tab. You might need to choose the right arrow button to show the tab. 2. For Query strings, enter type=Dog&page=2. 3. Choose Test. The result is similar to the following: Choose an HTTP integration tutorial 75 Amazon API Gateway Developer Guide Now that the test is successful, we can deploy the API to make it publicly available. 4. Choose Deploy API. 5. 6. 7. For Stage, select New stage. For Stage name, enter Prod. (Optional) For Description, enter a description. 8. Choose Deploy. 9. (Optional) Under Stage details, for Invoke URL, you can choose the copy icon to copy your API's invoke URL. You can use this with tools such as Postman and cURL to test your API. Choose an HTTP integration tutorial 76 Amazon API Gateway Developer Guide If you use an SDK to create a client, you can call the methods exposed by the SDK to sign the request. For implementation details, see the AWS SDK of your choosing. Note When changes are made to your API, you must redeploy the API to make the new or updated features available before invoking the request URL again. (Optional) Map request parameters Map request parameters for an API Gateway API This tutorial shows how to create a path parameter of {petId} on the API's method request to specify an item ID, map it to the {id} path parameter in the integration request URL, and send the request to the HTTP endpoint. Note If you enter the incorrect case of a letter, such as lowercase letter instead of an uppercase letter, this will cause errors later in the walkthrough. Step 1: |
apigateway-dg-027 | apigateway-dg.pdf | 27 | must redeploy the API to make the new or updated features available before invoking the request URL again. (Optional) Map request parameters Map request parameters for an API Gateway API This tutorial shows how to create a path parameter of {petId} on the API's method request to specify an item ID, map it to the {id} path parameter in the integration request URL, and send the request to the HTTP endpoint. Note If you enter the incorrect case of a letter, such as lowercase letter instead of an uppercase letter, this will cause errors later in the walkthrough. Step 1: Create resources In this step, you create a resource with a path parameter {petId}. To create the {petId} resource 1. Select the /pets resource, and then choose Create resource. 2. Keep Proxy resource turned off. 3. 4. For Resource path, select /pets/. For Resource name, enter {petId}. Use the curly braces ({ }) around petId so that /pets/{petId} is displayed. 5. Keep CORS (Cross Origin Resource Sharing) turned off. 6. Choose Create resource. Choose an HTTP integration tutorial 77 Amazon API Gateway Developer Guide Step 2: Create and test the methods In this step, you create a GET method with a {petId} path parameter. To set up GET method 1. 2. 3. Select the /{petId} resource, and then choose Create method. For Method type, select GET. For Integration type, select HTTP integration. 4. Keep HTTP proxy integration turned off. 5. 6. For HTTP method, select GET. For Endpoint URL, enter http://petstore-demo-endpoint.execute-api.com/ petstore/pets/{id} 7. For Content handling, select Passthrough. 8. Keep the Default timeout turned on. 9. Choose Create method. Now you map the {petId} path parameter that you just created to the {id} path parameter in the HTTP endpoint URL of the integration request. The HTTP endpoint URL was http:// petstore-demo-endpoint.execute-api.com/petstore/pets/{id}. To map the {petId} path parameter 1. On the Integration request tab, under Integration request settings, choose Edit. 2. Choose URL path parameters. 3. API Gateway creates a path parameter for the integration request named petId, however this path parameter isn't valid for the HTTP endpoint URL that you set as the backend integration. The HTTP endpoint uses {id} as the path parameter. For Name, delete petId and enter id. This maps the method request's path parameter of petId to the integration request's path parameter of id. 4. Choose Save. Now you test the method. Choose an HTTP integration tutorial 78 Amazon API Gateway To test the method Developer Guide 1. Choose the Test tab. You might need to choose the right arrow button to show the tab. 2. Under Path for petId, enter 4. 3. Choose Test. If successful, Response body displays the following: { "id": 4, "type": "bird", "price": 999.99 } Step 3: Deploy the API In this step, you deploy the API so that you can begin calling it outside of the API Gateway console. To deploy the API 1. Choose Deploy API. 2. 3. For Stage, select Prod. (Optional) For Description, enter a description. 4. Choose Deploy. Step 4: Test the API In this step, you go outside of the API Gateway console and use your API to access the HTTP endpoint. 1. In the main navigation pane, choose Stage. 2. Under Stage details, choose the copy icon to copy your API's invoke URL. It should look something like this: https://my-api-id.execute-api.region-id.amazonaws.com/prod Choose an HTTP integration tutorial 79 Amazon API Gateway Developer Guide 3. Enter this URL in the address box of a new browser tab and append /pets/4 to the URL before you submit your request. 4. The browser will return the following: { "id": 4, "type": "bird", "price": 999.99 } Next steps You can further customize your API by turning on request validation, transforming data, or creating custom gateway responses. To explore more ways to customize your API, see the following tutorials: • For more information about request validation, see Set up basic request validation in API Gateway. • For information about how to transform request and response payloads, see Tutorial: Modify the integration request and response for integrations to AWS services. • For information about how to create custom gateway responses see, Set up a gateway response for a REST API using the API Gateway console. Tutorial: Create a REST API with a private integration You can create an API Gateway API with private integration to provide your customers access to HTTP/HTTPS resources within your Amazon Virtual Private Cloud (Amazon VPC). Such VPC resources are HTTP/HTTPS endpoints on an EC2 instance behind a Network Load Balancer in the VPC. The Network Load Balancer encapsulates the VPC resource and routes incoming requests to the targeted resource. When a client calls the API, API Gateway connects to the Network Load Balancer through the pre-configured VPC link. A VPC link is encapsulated by an API Gateway |
apigateway-dg-028 | apigateway-dg.pdf | 28 | API Gateway console. Tutorial: Create a REST API with a private integration You can create an API Gateway API with private integration to provide your customers access to HTTP/HTTPS resources within your Amazon Virtual Private Cloud (Amazon VPC). Such VPC resources are HTTP/HTTPS endpoints on an EC2 instance behind a Network Load Balancer in the VPC. The Network Load Balancer encapsulates the VPC resource and routes incoming requests to the targeted resource. When a client calls the API, API Gateway connects to the Network Load Balancer through the pre-configured VPC link. A VPC link is encapsulated by an API Gateway resource of VpcLink. It is responsible for forwarding API method requests to the VPC resources and returns backend responses to the caller. For an API developer, a VpcLink is functionally equivalent to an integration endpoint. Tutorial: Create a REST API with a private integration 80 Amazon API Gateway Developer Guide To create an API with private integration, you must create a new VpcLink, or choose an existing one, that is connected to a Network Load Balancer that targets the desired VPC resources. You must have appropriate permissions to create and manage a VpcLink. You then set up an API method and integrate it with the VpcLink by setting either HTTP or HTTP_PROXY as the integration type, setting VPC_LINK as the integration connection type, and setting the VpcLink identifier on the integration connectionId. Note The Network Load Balancer and API must be owned by the same AWS account. To quickly get started creating an API to access VPC resources, we walk through the essential steps for building an API with the private integration, using the API Gateway console. Before creating the API, do the following: 1. Create a VPC resource, create or choose a Network Load Balancer under your account in the same region, and add the EC2 instance hosting the resource as a target of the Network Load Balancer. For more information, see Set up a Network Load Balancer for API Gateway private integrations. 2. Grant permissions to create the VPC links for private integrations. For more information, see Grant permissions for API Gateway to create a VPC link. After creating your VPC resource and your Network Load Balancer with your VPC resource configured in its target groups, follow the instructions below to create an API and integrate it with the VPC resource via a VpcLink in a private integration. To create an API with a private integration 1. 2. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway. If this is your first time using API Gateway, you see a page that introduces you to the features of the service. Under REST API, choose Build. When the Create Example API popup appears, choose OK. If this is not your first time using API Gateway, choose Create API. Under REST API, choose Build. 3. Create an edge-optimized or Regional REST API. For IP address type, use IPv4. Tutorial: Create a REST API with a private integration 81 Amazon API Gateway 4. Select your API. 5. Choose Create method, and then do the following: Developer Guide a. b. c. d. e. For Method type, select GET. For Integration type, select VPC link. Turn on VPC proxy integration. For HTTP method, select GET. For VPC link, select [Use stage variable] and enter ${stageVariables.vpcLinkId} in the text box below. You define the vpcLinkId stage variable after deploying the API to a stage and set its value to the ID of the VpcLink. f. For Endpoint URL, enter a URL, for example, http://myApi.example.com. The URL must be a valid top-level domain and the host name (for example, myApi.example.com) is used to set the Host header of the integration request. g. Choose Create method. With the proxy integration, the API is ready for deployment. Otherwise, you need to proceed to set up appropriate method responses and integration responses. 6. Choose Deploy API, and then do the following: a. b. c. For Stage, select New stage. For Stage name, enter a stage name. (Optional) For Description, enter a description. d. Choose Deploy. 7. Under the Stage details section, note the resulting Invoke URL. You need it to invoke the API. Before doing that, you must set up the vpcLinkId stage variable. 8. In the Stages pane, choose the Stage variables tab, and then do the following: a. b. c. Choose Manage variables, and then choose Add stage variable. For Name, enter vpcLinkId. For Value, enter the ID of VPC_LINK, for example, gix6s7. d. Choose Save. Tutorial: Create a REST API with a private integration 82 Amazon API Gateway Developer Guide Using the stage variable, you can easily switch to different VPC links for the API by changing the stage variable value. Tutorial: Create a REST API with an AWS integration Both the Tutorial: Create a REST |
apigateway-dg-029 | apigateway-dg.pdf | 29 | up the vpcLinkId stage variable. 8. In the Stages pane, choose the Stage variables tab, and then do the following: a. b. c. Choose Manage variables, and then choose Add stage variable. For Name, enter vpcLinkId. For Value, enter the ID of VPC_LINK, for example, gix6s7. d. Choose Save. Tutorial: Create a REST API with a private integration 82 Amazon API Gateway Developer Guide Using the stage variable, you can easily switch to different VPC links for the API by changing the stage variable value. Tutorial: Create a REST API with an AWS integration Both the Tutorial: Create a REST API with a Lambda proxy integration and Tutorial: Create a REST API with a Lambda non-proxy integration topics describe how to create an API Gateway API to expose the integrated Lambda function. In addition, you can create an API Gateway API to expose other AWS services, such as Amazon SNS, Amazon S3, Amazon Kinesis, and even AWS Lambda. This is made possible by the AWS integration. The Lambda integration or the Lambda proxy integration is a special case, where the Lambda function invocation is exposed through the API Gateway API. All AWS services support dedicated APIs to expose their features. However, the application protocols or programming interfaces are likely to differ from service to service. An API Gateway API with the AWS integration has the advantage of providing a consistent application protocol for your client to access different AWS services. In this walkthrough, we create an API to expose Amazon SNS. For more examples of integrating an API with other AWS services, see Amazon API Gateway tutorials and workshops. Unlike the Lambda proxy integration, there is no corresponding proxy integration for other AWS services. Hence, an API method is integrated with a single AWS action. For more flexibility, similar to the proxy integration, you can set up a Lambda proxy integration. The Lambda function then parses and processes requests for other AWS actions. API Gateway does not retry when the endpoint times out. The API caller must implement retry logic to handle endpoint timeouts. This walkthrough builds on the instructions and concepts in Tutorial: Create a REST API with a Lambda non-proxy integration. If you have not yet completed that walkthrough, we suggest that you do it first. Topics • Prerequisites • Step 1: Create the AWS service proxy execution role • Step 2: Create the resource Tutorial: Create a REST API with an AWS integration 83 Amazon API Gateway Developer Guide • Step 3: Create the GET method • Step 4: Specify method settings and test the method • Step 5: Deploy the API • Step 6: Test the API • Step 7: Clean up Prerequisites Before you begin this walkthrough, do the following: 1. Complete the steps in Set up to use API Gateway. 2. Create a new API named MyDemoAPI. For more information, see Tutorial: Create a REST API with an HTTP non-proxy integration. 3. Deploy the API at least once to a stage named test. For more information, see Deploy the API in Choose an AWS Lambda integration tutorial. 4. Complete the rest of the steps in Choose an AWS Lambda integration tutorial. 5. Create at least one topic in Amazon Simple Notification Service (Amazon SNS). You will use the deployed API to get a list of topics in Amazon SNS that are associated with your AWS account. To learn how to create a topic in Amazon SNS, see Create a Topic. (You do not need to copy the topic ARN mentioned in step 5.) Step 1: Create the AWS service proxy execution role To allow the API to invoke Amazon SNS actions, you must have the appropriate IAM policies attached to an IAM role. In this step, you create a new IAM role. To create the AWS service proxy execution role 1. Sign in to the AWS Management Console and open the IAM console at https:// console.aws.amazon.com/iam/. 2. Choose Roles. 3. Choose Create role. 4. Choose AWS service under Select type of trusted entity, and then select API Gateway and select Allows API Gateway to push logs to CloudWatch Logs. 5. Choose Next, and then choose Next. Tutorial: Create a REST API with an AWS integration 84 Amazon API Gateway Developer Guide 6. 7. For Role name, enter APIGatewaySNSProxyPolicy, and then choose Create role. In the Roles list, choose the role you just created. You may need to scroll or use the search bar to find the role. 8. For the selected role, select the Add permissions tab. 9. Choose Attach policies from the dropdown list. 10. In the search bar, enter AmazonSNSReadOnlyAccess and choose Add permissions. Note This tutorial uses a managed policy for simplicity. As a best practice, you should create your own IAM policy to grant the minimum permissions required. 11. Note |
apigateway-dg-030 | apigateway-dg.pdf | 30 | integration 84 Amazon API Gateway Developer Guide 6. 7. For Role name, enter APIGatewaySNSProxyPolicy, and then choose Create role. In the Roles list, choose the role you just created. You may need to scroll or use the search bar to find the role. 8. For the selected role, select the Add permissions tab. 9. Choose Attach policies from the dropdown list. 10. In the search bar, enter AmazonSNSReadOnlyAccess and choose Add permissions. Note This tutorial uses a managed policy for simplicity. As a best practice, you should create your own IAM policy to grant the minimum permissions required. 11. Note the newly created Role ARN, you will use it later. Step 2: Create the resource In this step, you create a resource that enables the AWS service proxy to interact with the AWS service. To create the resource 1. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway. 2. Choose your API. 3. Select the root resource, /, represented by a single forward slash (/), and then choose Create resource. 4. Keep Proxy resource turned off. 5. Keep Resource path as /. 6. For Resource name, enter mydemoawsproxy. 7. Keep CORS (Cross Origin Resource Sharing) turned off. 8. Choose Create resource. Step 3: Create the GET method In this step, you create a GET method that enables the AWS service proxy to interact with the AWS service. Tutorial: Create a REST API with an AWS integration 85 Amazon API Gateway To create the GET method Developer Guide 1. 2. 3. 4. 5. Select the /mydemoawsproxy resource, and then choose Create method. For method type, select GET. For Integration type, select AWS service. For AWS Region, select the AWS Region where you created your Amazon SNS topic. For AWS service, select Amazon SNS. 6. Keep AWS subdomain blank. 7. 8. 9. For HTTP method, select GET. For Action type, select Use action name. For Action name, enter ListTopics. 10. For Execution role, enter the role ARN for APIGatewaySNSProxyPolicy. 11. Choose Create method. Step 4: Specify method settings and test the method You can now test your GET method to verify that it has been properly set up to list your Amazon SNS topics. To test the GET method 1. Choose the Test tab. You might need to choose the right arrow button to show the tab. 2. Choose Test. The result displays response similar to the following: { "ListTopicsResponse": { "ListTopicsResult": { "NextToken": null, "Topics": [ { "TopicArn": "arn:aws:sns:us-east-1:80398EXAMPLE:MySNSTopic-1" }, { "TopicArn": "arn:aws:sns:us-east-1:80398EXAMPLE:MySNSTopic-2" }, Tutorial: Create a REST API with an AWS integration 86 Amazon API Gateway ... Developer Guide { "TopicArn": "arn:aws:sns:us-east-1:80398EXAMPLE:MySNSTopic-N" } ] }, "ResponseMetadata": { "RequestId": "abc1de23-45fa-6789-b0c1-d2e345fa6b78" } } } Step 5: Deploy the API In this step, you deploy the API so that you can call it from outside of the API Gateway console. To deploy the API 1. Choose Deploy API. 2. 3. 4. For Stage, select New stage. For Stage name, enter test. (Optional) For Description, enter a description. 5. Choose Deploy. Step 6: Test the API In this step, you go outside of the API Gateway console and use your AWS service proxy to interact with the Amazon SNS service. 1. In the main navigation pane, choose Stage. 2. Under Stage details, choose the copy icon to copy your API's invoke URL. It should look like this: https://my-api-id.execute-api.region-id.amazonaws.com/test 3. Enter the URL into the address box of a new browser tab. 4. Append /mydemoawsproxy so that the URL looks like this: Tutorial: Create a REST API with an AWS integration 87 Amazon API Gateway Developer Guide https://my-api-id.execute-api.region-id.amazonaws.com/test/mydemoawsproxy Browse to the URL. Information similar to the following should be displayed: {"ListTopicsResponse":{"ListTopicsResult":{"NextToken": null,"Topics": [{"TopicArn": "arn:aws:sns:us-east-1:80398EXAMPLE:MySNSTopic-1"},{"TopicArn": "arn:aws:sns:us-east-1:80398EXAMPLE:MySNSTopic-2"},...{"TopicArn": "arn:aws:sns:us-east-1:80398EXAMPLE:MySNSTopic-N}]},"ResponseMetadata": {"RequestId":"abc1de23-45fa-6789-b0c1-d2e345fa6b78}}} Step 7: Clean up You can delete the IAM resources the AWS service proxy needs to work. Warning If you delete an IAM resource an AWS service proxy relies on, that AWS service proxy and any APIs that rely on it will no longer work. Deleting an IAM resource cannot be undone. If you want to use the IAM resource again, you must re-create it. To delete the associated IAM resources 1. Open the IAM console at https://console.aws.amazon.com/iam/. 2. 3. 4. 5. In the Details area, choose Roles. Select APIGatewayAWSProxyExecRole, and then choose Role Actions, Delete Role. When prompted, choose Yes, Delete. In the Details area, choose Policies. Select APIGatewayAWSProxyExecPolicy, and then choose Policy Actions, Delete. When prompted, choose Delete. You have reached the end of this walkthrough. For more detailed discussions about creating API as an AWS service proxy, see Tutorial: Create a REST API as an Amazon S3 proxy, Tutorial: Create a calculator REST API with two AWS service integrations and one Lambda non-proxy integration, or Tutorial: Create a REST API as an Amazon Kinesis proxy. Tutorial: Create a REST API with an AWS integration 88 |
apigateway-dg-031 | apigateway-dg.pdf | 31 | Select APIGatewayAWSProxyExecRole, and then choose Role Actions, Delete Role. When prompted, choose Yes, Delete. In the Details area, choose Policies. Select APIGatewayAWSProxyExecPolicy, and then choose Policy Actions, Delete. When prompted, choose Delete. You have reached the end of this walkthrough. For more detailed discussions about creating API as an AWS service proxy, see Tutorial: Create a REST API as an Amazon S3 proxy, Tutorial: Create a calculator REST API with two AWS service integrations and one Lambda non-proxy integration, or Tutorial: Create a REST API as an Amazon Kinesis proxy. Tutorial: Create a REST API with an AWS integration 88 Amazon API Gateway Developer Guide Tutorial: Create a calculator REST API with two AWS service integrations and one Lambda non-proxy integration The the section called “Tutorial: Create a REST API with a Lambda non-proxy integration” uses Lambda Function integration exclusively. Lambda Function integration is a special case of the AWS Service integration type that performs much of the integration setup for you, such as automatically adding the required resource-based permissions for invoking the Lambda function. Here, two of the three integrations use AWS Service integration. In this integration type, you have more control, but you'll need to manually perform tasks like creating and specifying an IAM role containing appropriate permissions. In this tutorial, you'll create a Calc Lambda function that implements basic arithmetic operations, accepting and returning JSON-formatted input and output. Then you'll create a REST API and integrate it with the Lambda function in the following ways: 1. By exposing a GET method on the /calc resource to invoke the Lambda function, supplying the input as query string parameters. (AWS Service integration) 2. By exposing a POST method on the /calc resource to invoke the Lambda function, supplying the input in the method request payload. (AWS Service integration) 3. By exposing a GET on nested /calc/{operand1}/{operand2}/{operator} resources to invoke the Lambda function, supplying the input as path parameters. (Lambda Function integration) In addition to trying out this tutorial, you may wish to study the OpenAPI definition file for the Calc API, which you can import into API Gateway by following the instructions in the section called “OpenAPI”. Topics • Create an assumable IAM role • Create a Calc Lambda function • Test the Calc Lambda function • Create a Calc API • Integration 1: Create a GET method with query parameters to call the Lambda function • Integration 2: Create a POST method with a JSON payload to call the Lambda function • Integration 3: Create a GET method with path parameters to call the Lambda function Tutorial: Create a calculator REST API with three integrations 89 Amazon API Gateway Developer Guide • OpenAPI definitions of sample API integrated with a Lambda function Create an assumable IAM role In order for your API to invoke your Calc Lambda function, you'll need to have an API Gateway assumable IAM role, which is an IAM role with the following trusted relationship: { "Version": "2012-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", "Principal": { "Service": "apigateway.amazonaws.com" }, "Action": "sts:AssumeRole" } ] } The role you create will need to have Lambda InvokeFunction permission. Otherwise, the API caller will receive a 500 Internal Server Error response. To give the role this permission, you'll attach the following IAM policy to it: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "lambda:InvokeFunction", "Resource": "*" } ] } Here's how to accomplish all this: Create an API Gateway assumable IAM role 1. Log in to the IAM console. Tutorial: Create a calculator REST API with three integrations 90 Amazon API Gateway 2. Choose Roles. 3. Choose Create Role. 4. Under Select type of trusted entity, choose AWS Service. 5. Under Choose the service that will use this role, choose Lambda. 6. Choose Next: Permissions. 7. Choose Create Policy. Developer Guide A new Create Policy console window will open up. In that window, do the following: a. In the JSON tab, replace the existing policy with the following: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "lambda:InvokeFunction", "Resource": "*" } ] } b. Choose Review policy. c. Under Review Policy, do the following: i. ii. For Name, type a name such as lambda_execute. Choose Create Policy. 8. In the original Create Role console window, do the following: a. Under Attach permissions policies, choose your lambda_execute policy from the dropdown list. If you don't see your policy in the list, choose the refresh button at the top of the list. (Don't refresh the browser page!) b. Choose Next:Tags. c. Choose Next:Review. Tutorial: Create a calculator REST API with three integrations 91 Amazon API Gateway Developer Guide d. For the Role name, type a name such as lambda_invoke_function_assume_apigw_role. e. Choose Create role. 9. Choose your lambda_invoke_function_assume_apigw_role from the list of roles. 10. Choose the Trust relationships tab. 11. |
apigateway-dg-032 | apigateway-dg.pdf | 32 | 8. In the original Create Role console window, do the following: a. Under Attach permissions policies, choose your lambda_execute policy from the dropdown list. If you don't see your policy in the list, choose the refresh button at the top of the list. (Don't refresh the browser page!) b. Choose Next:Tags. c. Choose Next:Review. Tutorial: Create a calculator REST API with three integrations 91 Amazon API Gateway Developer Guide d. For the Role name, type a name such as lambda_invoke_function_assume_apigw_role. e. Choose Create role. 9. Choose your lambda_invoke_function_assume_apigw_role from the list of roles. 10. Choose the Trust relationships tab. 11. Choose Edit trust relationship. 12. Replace the existing policy with the following: { "Version": "2012-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", "Principal": { "Service": [ "lambda.amazonaws.com", "apigateway.amazonaws.com" ] }, "Action": "sts:AssumeRole" } ] } 13. Choose Update Trust Policy. 14. Make a note of the role ARN for the role you just created. You'll need it later. Create a Calc Lambda function Next you'll create a Lambda function using the Lambda console. 1. In the Lambda console, choose Create function. 2. Choose Author from Scratch. 3. 4. For Name, enter Calc. For Runtime, choose either the latest supported Node.js or Python runtime. Tutorial: Create a calculator REST API with three integrations 92 Amazon API Gateway Developer Guide 5. For all other options, use the default setting. 6. Choose Create function. 7. Copy the following Lambda function in your preferred runtime and paste it into the code editor in the Lambda console. Node.js export const handler = async function (event, context) { console.log("Received event:", JSON.stringify(event)); if ( event.a === undefined || event.b === undefined || event.op === undefined ) { return "400 Invalid Input"; } const res = {}; res.a = Number(event.a); res.b = Number(event.b); res.op = event.op; if (isNaN(event.a) || isNaN(event.b)) { return "400 Invalid Operand"; } switch (event.op) { case "+": case "add": res.c = res.a + res.b; break; case "-": case "sub": res.c = res.a - res.b; break; case "*": case "mul": res.c = res.a * res.b; break; case "/": case "div": if (res.b == 0) { return "400 Divide by Zero"; Tutorial: Create a calculator REST API with three integrations 93 Amazon API Gateway Developer Guide } else { res.c = res.a / res.b; } break; default: return "400 Invalid Operator"; } return res; }; Python import json def lambda_handler(event, context): print(event) try: (event['a']) and (event['b']) and (event['op']) except KeyError: return '400 Invalid Input' try: res = { "a": float( event['a']), "b": float( event['b']), "op": event['op']} except ValueError: return '400 Invalid Operand' if event['op'] == '+': res['c'] = res['a'] + res['b'] elif event['op'] == '-': res['c'] = res['a'] - res['b'] elif event['op'] == '*': res['c'] = res['a'] * res['b'] elif event['op'] == '/': if res['b'] == 0: return '400 Divide by Zero' else: res['c'] = res['a'] / res['b'] Tutorial: Create a calculator REST API with three integrations 94 Amazon API Gateway else: return '400 Invalid Operator' return res Developer Guide 8. Under Execution role, choose Choose an existing role. 9. Enter the role ARN for the lambda_invoke_function_assume_apigw_role role you created earlier. 10. Choose Deploy. This function requires two operands (a and b) and an operator (op) from the event input parameter. The input is a JSON object of the following format: { "a": "Number" | "String", "b": "Number" | "String", "op": "String" } This function returns the calculated result (c) and the input. For an invalid input, the function returns either the null value or the "Invalid op" string as the result. The output is of the following JSON format: { "a": "Number", "b": "Number", "op": "String", "c": "Number" | "String" } You should test the function in the Lambda console before integrating it with the API in the next step. Test the Calc Lambda function Here's how to test your Calc function in the Lambda console: Tutorial: Create a calculator REST API with three integrations 95 Amazon API Gateway 1. Choose the Test tab. 2. For the test event name, enter calc2plus5. 3. Replace the test event definition with the following: Developer Guide { "a": "2", "b": "5", "op": "+" } 4. Choose Save. 5. Choose Test. 6. Expand Execution result: succeeded. You should see the following: { "a": 2, "b": 5, "op": "+", "c": 7 } Create a Calc API The following procedure shows how to create an API for the Calc Lambda function you just created. In subsequent sections, you'll add resources and methods to it. To create an API 1. 2. 3. 4. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway. If this is your first time using API Gateway, you see a page that introduces you to the features of the service. Under REST API, choose Build. When the Create Example API popup appears, choose OK. If this is not |
apigateway-dg-033 | apigateway-dg.pdf | 33 | the following: { "a": 2, "b": 5, "op": "+", "c": 7 } Create a Calc API The following procedure shows how to create an API for the Calc Lambda function you just created. In subsequent sections, you'll add resources and methods to it. To create an API 1. 2. 3. 4. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway. If this is your first time using API Gateway, you see a page that introduces you to the features of the service. Under REST API, choose Build. When the Create Example API popup appears, choose OK. If this is not your first time using API Gateway, choose Create API. Under REST API, choose Build. For API name, enter LambdaCalc. (Optional) For Description, enter a description. Tutorial: Create a calculator REST API with three integrations 96 Amazon API Gateway Developer Guide 5. Keep API endpoint type set to Regional. 6. For IP address type, select IPv4. 7. Choose Create API. Integration 1: Create a GET method with query parameters to call the Lambda function By creating a GET method that passes query string parameters to the Lambda function, you enable the API to be invoked from a browser. This approach can be useful, especially for APIs that allow open access. After you create an API, you create a resource. Typically, API resources are organized in a resource tree according to the application logic. For this step, you create a /calc resource. To create a /calc resource 1. Choose Create resource. 2. Keep Proxy resource turned off. 3. Keep Resource path as /. 4. For Resource name, enter calc. 5. Keep CORS (Cross Origin Resource Sharing) turned off. 6. Choose Create resource. By creating a GET method that passes query string parameters to the Lambda function, you enable the API to be invoked from a browser. This approach can be useful, especially for APIs that allow open access. In this method, Lambda requires that the POST request be used to invoke any Lambda function. This example shows that the HTTP method in a frontend method request can be different from the integration request in the backend. To create a GET method 1. 2. 3. Select the /calc resource, and then choose Create method. For Method type, select GET. For Integration type, select AWS service. Tutorial: Create a calculator REST API with three integrations 97 Amazon API Gateway Developer Guide 4. 5. For AWS Region, select the AWS Region where you created your Lambda function. For AWS service, select Lambda. 6. Keep AWS subdomain blank. 7. 8. 9. For HTTP method, select POST. For Action type, select Use path override. This option allows us to specify the ARN of the Invoke action to execute our Calc function. For Path override, enter 2015-03-31/functions/arn:aws:lambda:us- east-2:account-id:function:Calc/invocations. For account-id, enter your AWS account ID. For us-east-2, enter the AWS Region where you created your Lambda function. 10. For Execution role, enter the role ARN for lambda_invoke_function_assume_apigw_role. 11. Do not change the settings of Credential cache and Default timeout. 12. Choose Method request settings. 13. For Request validator, select Validate query string parameters and headers. This setting will cause an error message to return if the client does not specify the required parameters. 14. Choose URL query string parameters. Now you set up query string parameters for the GET method on the /calc resource so it can receive input on behalf of the backend Lambda function. To create the query string parameters do the following: a. b. c. Choose Add query string. For Name, enter operand1. Turn on Required. d. Keep Caching turned off. Repeat the same steps and create a query string named operand2 and a query string named operator. 15. Choose Create method. Tutorial: Create a calculator REST API with three integrations 98 Amazon API Gateway Developer Guide Now, you create a mapping template to translate the client-supplied query strings to the integration request payload as required by the Calc function. This template maps the three query string parameters declared in Method request into designated property values of the JSON object as the input to the backend Lambda function. The transformed JSON object will be included as the integration request payload. To map input parameters to the integration request 1. On the Integration request tab, under Integration request settings, choose Edit. 2. For Request body passthrough, select When there are no templates defined (recommended). 3. Choose Mapping templates. 4. Choose Add mapping template. 5. 6. For Content type, enter application/json. For Template body, enter the following code: { "a": "$input.params('operand1')", "b": "$input.params('operand2')", "op": "$input.params('operator')" } 7. Choose Save. You can now test your GET method to verify that it has been properly set up to invoke the Lambda function. To test the GET method 1. Choose the Test tab. You might need to choose the right |
apigateway-dg-034 | apigateway-dg.pdf | 34 | the integration request 1. On the Integration request tab, under Integration request settings, choose Edit. 2. For Request body passthrough, select When there are no templates defined (recommended). 3. Choose Mapping templates. 4. Choose Add mapping template. 5. 6. For Content type, enter application/json. For Template body, enter the following code: { "a": "$input.params('operand1')", "b": "$input.params('operand2')", "op": "$input.params('operator')" } 7. Choose Save. You can now test your GET method to verify that it has been properly set up to invoke the Lambda function. To test the GET method 1. Choose the Test tab. You might need to choose the right arrow button to show the tab. 2. For Query strings, enter operand1=2&operand2=3&operator=+. 3. Choose Test. The results should look similar to this: Tutorial: Create a calculator REST API with three integrations 99 Amazon API Gateway Developer Guide Integration 2: Create a POST method with a JSON payload to call the Lambda function By creating a POST method with a JSON payload to call the Lambda function, you make it so that the client must provide the necessary input to the backend function in the request body. To ensure that the client uploads the correct input data, you'll enable request validation on the payload. To create a POST method with a JSON payload 1. 2. 3. 4. 5. Select the /calc resource, and then choose Create method. For Method type, select POST. For Integration type, select AWS service. For AWS Region, select the AWS Region where you created your Lambda function. For AWS service, select Lambda. 6. Keep AWS subdomain blank. 7. 8. 9. For HTTP method, select POST. For Action type, select Use path override. This option allows us to specify the ARN of the Invoke action to execute our Calc function. For Path override, enter 2015-03-31/functions/arn:aws:lambda:us- east-2:account-id:function:Calc/invocations. For account-id, enter your AWS account ID. For us-east-2, enter the AWS Region where you created your Lambda function. 10. For Execution role, enter the role ARN for lambda_invoke_function_assume_apigw_role. 11. Do not change the settings of Credential cache and Default timeout. 12. Choose Create method. Tutorial: Create a calculator REST API with three integrations 100 Amazon API Gateway Developer Guide Now you create an input model to describe the input data structure and validate the incoming request body. To create an input model 1. In the main navigation pane, choose Models. 2. Choose Create model. 3. 4. For Name, enter input. For Content type, enter application/json. If no matching content type is found, request validation is not performed. To use the same model regardless of the content type, enter $default. 5. For Model schema, enter the following model: { "type":"object", "properties":{ "a":{"type":"number"}, "b":{"type":"number"}, "op":{"type":"string"} }, "title":"input" } 6. Choose Create model. You now create an output model. This model describes the data structure of the calculated output from the backend. It can be used to map the integration response data to a different model. This tutorial relies on the passthrough behavior and does not use this model. To create an output model 1. Choose Create model. 2. 3. For Name, enter output. For Content type, enter application/json. If no matching content type is found, request validation is not performed. To use the same model regardless of the content type, enter $default. Tutorial: Create a calculator REST API with three integrations 101 Amazon API Gateway Developer Guide 4. For Model schema, enter the following model: { "type":"object", "properties":{ "c":{"type":"number"} }, "title":"output" } 5. Choose Create model. You now create a result model. This model describes the data structure of the returned response data. It references both the input and output schemas defined in your API. To create a result model 1. Choose Create model. 2. 3. 4. For Name, enter result. For Content type, enter application/json. If no matching content type is found, request validation is not performed. To use the same model regardless of the content type, enter $default. For Model schema, enter the following model with your restapi-id. Your restapi-id is listed in parenthesis at the top of the console in the following flow: API Gateway > APIs > LambdaCalc (abc123). { "type":"object", "properties":{ "input":{ "$ref":"https://apigateway.amazonaws.com/restapis/restapi-id/models/ input" }, "output":{ "$ref":"https://apigateway.amazonaws.com/restapis/restapi-id/models/ output" } }, "title":"result" Tutorial: Create a calculator REST API with three integrations 102 Amazon API Gateway } 5. Choose Create model. Developer Guide You now configure the method request of your POST method to enable request validation on the incoming request body. To enable request validation on the POST method 1. In the main navigation pane, choose Resources, and then select the POST method from the resource tree. 2. On the Method request tab, under Method request settings, choose Edit. 3. For Request validator, select Validate body. 4. Choose Request body, and then choose Add model. 5. For Content type, enter application/json. If no matching content type is found, request |
apigateway-dg-035 | apigateway-dg.pdf | 35 | three integrations 102 Amazon API Gateway } 5. Choose Create model. Developer Guide You now configure the method request of your POST method to enable request validation on the incoming request body. To enable request validation on the POST method 1. In the main navigation pane, choose Resources, and then select the POST method from the resource tree. 2. On the Method request tab, under Method request settings, choose Edit. 3. For Request validator, select Validate body. 4. Choose Request body, and then choose Add model. 5. For Content type, enter application/json. If no matching content type is found, request validation is not performed. To use the same model regardless of the content type, enter $default. 6. For Model, select input. 7. Choose Save. You can now test your POST method to verify that it has been properly set up to invoke the Lambda function. To test the POST method 1. Choose the Test tab. You might need to choose the right arrow button to show the tab. 2. For Request body, enter the following JSON payload. { "a": 1, "b": 2, "op": "+" } 3. Choose Test. Tutorial: Create a calculator REST API with three integrations 103 Amazon API Gateway Developer Guide You should see the following output: { "a": 1, "b": 2, "op": "+", "c": 3 } Integration 3: Create a GET method with path parameters to call the Lambda function Now you'll create a GET method on a resource specified by a sequence of path parameters to call the backend Lambda function. The path parameter values specify the input data to the Lambda function. You'll use a mapping template to map the incoming path parameter values to the required integration request payload. The resulting API resource structure will look like this: Tutorial: Create a calculator REST API with three integrations 104 Amazon API Gateway Developer Guide To create a /{operand1}/{operand2}/{operator} resource 1. Choose Create resource. 2. 3. For Resource path, select /calc. For Resource name, enter {operand1}. 4. Keep CORS (Cross Origin Resource Sharing) turned off. 5. Choose Create resource. 6. 7. For Resource path, select /calc/{operand1}/. For Resource name, enter {operand2}. 8. Keep CORS (Cross Origin Resource Sharing) turned off. 9. Choose Create resource. 10. For Resource path, select /calc/{operand1}/{operand2}/. 11. For Resource name, enter {operator}. Tutorial: Create a calculator REST API with three integrations 105 Amazon API Gateway Developer Guide 12. Keep CORS (Cross Origin Resource Sharing) turned off. 13. Choose Create resource. This time you'll use the built-in Lambda integration in the API Gateway console to set up the method integration. To set up a method integration 1. 2. 3. Select the /{operand1}/{operand2}/{operator} resource, and then choose Create method. For Method type, select GET. For Integration type, select Lambda. 4. Keep Lambda proxy integration turned off. 5. For Lambda function, select the AWS Region where you created your Lambda function and enter Calc. 6. Keep Default timeout turned on. 7. Choose Create method. You now create a mapping template to map the three URL path parameters, declared when the / calc/{operand1}/{operand2}/{operator} resource was created, into designated property values in the JSON object. Because URL paths must be URL-encoded, the division operator must be specified as %2F instead of /. This template translates the %2F into '/' before passing it to the Lambda function. To create a mapping template 1. On the Integration request tab, under Integration request settings, choose Edit. 2. For Request body passthrough, select When there are no templates defined (recommended). 3. Choose Mapping templates. 4. 5. For Content type, enter application/json. For Template body, enter the following code: { "a": "$input.params('operand1')", "b": "$input.params('operand2')", Tutorial: Create a calculator REST API with three integrations 106 Amazon API Gateway "op": Developer Guide #if($input.params('operator')=='%2F')"/"#{else}"$input.params('operator')"#end } 6. Choose Save. You can now test your GET method to verify that it has been properly set up to invoke the Lambda function and pass the original output through the integration response without mapping. To test the GET method 1. Choose the Test tab. You might need to choose the right arrow button to show the tab. 2. For the Path, do the following: a. b. c. For operand1, enter 1. For operand2, enter 1. For operator, enter +. 3. Choose Test. 4. The result should look like this: Next, you model the data structure of the method response payload after the result schema. By default, the method response body is assigned an empty model. This will cause the integration response body to be passed through without mapping. However, when you generate an SDK for one of the strongly-type languages, such as Java or Objective-C, your SDK users will receive an empty object as the result. To ensure that both the REST client and SDK clients receive the desired result, you must model the response data using a predefined |
apigateway-dg-036 | apigateway-dg.pdf | 36 | 3. Choose Test. 4. The result should look like this: Next, you model the data structure of the method response payload after the result schema. By default, the method response body is assigned an empty model. This will cause the integration response body to be passed through without mapping. However, when you generate an SDK for one of the strongly-type languages, such as Java or Objective-C, your SDK users will receive an empty object as the result. To ensure that both the REST client and SDK clients receive the desired result, you must model the response data using a predefined schema. Here you'll define a model for the method response body and to construct a mapping template to translate the integration response body into the method response body. Tutorial: Create a calculator REST API with three integrations 107 Amazon API Gateway To create a method response Developer Guide 1. On the Method response tab, under Response 200, choose Edit. 2. Under Response body, choose Add model. 3. 4. For Content type, enter application/json. For Model, select result. 5. Choose Save. Setting the model for the method response body ensures that the response data will be cast into the result object of a given SDK. To make sure that the integration response data is mapped accordingly, you'll need a mapping template. To create a mapping template 1. On the Integration response tab, under Default - Response, choose Edit. 2. Choose Mapping templates. 3. 4. For Content type, enter application/json. For Template body, enter the following code: #set($inputRoot = $input.path('$')) { "input" : { "a" : $inputRoot.a, "b" : $inputRoot.b, "op" : "$inputRoot.op" }, "output" : { "c" : $inputRoot.c } } 5. Choose Save. To test the mapping template 1. Choose the Test tab. You might need to choose the right arrow button to show the tab. 2. For the Path, do the following: Tutorial: Create a calculator REST API with three integrations 108 Amazon API Gateway Developer Guide a. b. c. For operand1, enter 1. For operand2, enter 2. For operator, enter +. 3. Choose Test. 4. The result will look like the following: { "input": { "a": 1, "b": 2, "op": "+" }, "output": { "c": 3 } } At this point, you can only call the API using the Test feature in the API Gateway console. To make it available to clients, you'll need to deploy your API. Always be sure to redeploy your API whenever you add, modify, or delete a resource or method, update a data mapping, or update stage settings. Otherwise, new features or updates will not be available to clients of your API. as follows: To deploy the API 1. Choose Deploy API. 2. 3. 4. For Stage, select New stage. For Stage name, enter Prod. (Optional) For Description, enter a description. 5. Choose Deploy. 6. (Optional) Under Stage details, for Invoke URL, you can choose the copy icon to copy your API's invoke URL. You can use this with tools such as Postman and cURL to test your API. Tutorial: Create a calculator REST API with three integrations 109 Amazon API Gateway Note Developer Guide Always redeploy your API whenever you add, modify, or delete a resource or method, update a data mapping, or update stage settings. Otherwise, new features or updates will not be available to clients of your API. OpenAPI definitions of sample API integrated with a Lambda function OpenAPI 2.0 { "swagger": "2.0", "info": { "version": "2017-04-20T04:08:08Z", "title": "LambdaCalc" }, "host": "uojnr9hd57.execute-api.us-east-1.amazonaws.com", "basePath": "/test", "schemes": [ "https" ], "paths": { "/calc": { "get": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "operand2", "in": "query", "required": true, "type": "string" }, { "name": "operator", "in": "query", Tutorial: Create a calculator REST API with three integrations 110 Amazon API Gateway Developer Guide "required": true, "type": "string" }, { "name": "operand1", "in": "query", "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Result" }, "headers": { "operand_1": { "type": "string" }, "operand_2": { "type": "string" }, "operator": { "type": "string" } } } }, "x-amazon-apigateway-request-validator": "Validate query string parameters and headers", "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "responses": { "default": { "statusCode": "200", "responseParameters": { "method.response.header.operator": "integration.response.body.op", "method.response.header.operand_2": "integration.response.body.b", "method.response.header.operand_1": "integration.response.body.a" }, "responseTemplates": { Tutorial: Create a calculator REST API with three integrations 111 Amazon API Gateway Developer Guide "application/json": "#set($res = $input.path('$'))\n{\n \"result \": \"$res.a, $res.b, $res.op => $res.c\",\n \"a\" : \"$res.a\",\n \"b\" : \"$res.b\",\n \"op\" : \"$res.op\",\n \"c\" : \"$res.c\"\n}" } } }, "uri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/ arn:aws:lambda:us-west-2:123456789012:function:Calc/invocations", "passthroughBehavior": "when_no_match", "httpMethod": "POST", "requestTemplates": { "application/json": "{\n \"a\": \"$input.params('operand1')\",\n \"b\": \"$input.params('operand2')\", \n \"op\": \"$input.params('operator')\" \n}" }, "type": "aws" } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "Input", "required": true, "schema": { "$ref": "#/definitions/Input" } } |
apigateway-dg-037 | apigateway-dg.pdf | 37 | { "method.response.header.operator": "integration.response.body.op", "method.response.header.operand_2": "integration.response.body.b", "method.response.header.operand_1": "integration.response.body.a" }, "responseTemplates": { Tutorial: Create a calculator REST API with three integrations 111 Amazon API Gateway Developer Guide "application/json": "#set($res = $input.path('$'))\n{\n \"result \": \"$res.a, $res.b, $res.op => $res.c\",\n \"a\" : \"$res.a\",\n \"b\" : \"$res.b\",\n \"op\" : \"$res.op\",\n \"c\" : \"$res.c\"\n}" } } }, "uri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/ arn:aws:lambda:us-west-2:123456789012:function:Calc/invocations", "passthroughBehavior": "when_no_match", "httpMethod": "POST", "requestTemplates": { "application/json": "{\n \"a\": \"$input.params('operand1')\",\n \"b\": \"$input.params('operand2')\", \n \"op\": \"$input.params('operator')\" \n}" }, "type": "aws" } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "Input", "required": true, "schema": { "$ref": "#/definitions/Input" } } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Result" } } }, "x-amazon-apigateway-request-validator": "Validate body", Tutorial: Create a calculator REST API with three integrations 112 Amazon API Gateway Developer Guide "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "responses": { "default": { "statusCode": "200", "responseTemplates": { "application/json": "#set($inputRoot = $input.path('$'))\n{\n \"a \" : $inputRoot.a,\n \"b\" : $inputRoot.b,\n \"op\" : $inputRoot.op,\n \"c\" : $inputRoot.c\n}" } } }, "uri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/ arn:aws:lambda:us-west-2:123456789012:function:Calc/invocations", "passthroughBehavior": "when_no_templates", "httpMethod": "POST", "type": "aws" } } }, "/calc/{operand1}/{operand2}/{operator}": { "get": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "operand2", "in": "path", "required": true, "type": "string" }, { "name": "operator", "in": "path", "required": true, "type": "string" }, { "name": "operand1", "in": "path", Tutorial: Create a calculator REST API with three integrations 113 Amazon API Gateway Developer Guide "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Result" } } }, "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "responses": { "default": { "statusCode": "200", "responseTemplates": { "application/json": "#set($inputRoot = $input.path('$'))\n{\n \"input\" : {\n \"a\" : $inputRoot.a,\n \"b\" : $inputRoot.b,\n \"op\" : \"$inputRoot.op\"\n },\n \"output\" : {\n \"c\" : $inputRoot.c\n }\n}" } } }, "uri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/ arn:aws:lambda:us-west-2:123456789012:function:Calc/invocations", "passthroughBehavior": "when_no_templates", "httpMethod": "POST", "requestTemplates": { "application/json": "{\n \"a\": \"$input.params('operand1')\", \n \"b\": \"$input.params('operand2')\",\n \"op\": #if($input.params('operator')=='%2F')\"/\"#{else}\"$input.params('operator')\"#end \n \n}" }, "contentHandling": "CONVERT_TO_TEXT", "type": "aws" } } } }, "definitions": { "Input": { "type": "object", "required": [ Tutorial: Create a calculator REST API with three integrations 114 Developer Guide Amazon API Gateway "a", "b", "op" ], "properties": { "a": { "type": "number" }, "b": { "type": "number" }, "op": { "type": "string", "description": "binary op of ['+', 'add', '-', 'sub', '*', 'mul', '%2F', 'div']" } }, "title": "Input" }, "Output": { "type": "object", "properties": { "c": { "type": "number" } }, "title": "Output" }, "Result": { "type": "object", "properties": { "input": { "$ref": "#/definitions/Input" }, "output": { "$ref": "#/definitions/Output" } }, "title": "Result" } }, "x-amazon-apigateway-request-validators": { "Validate body": { "validateRequestParameters": false, Tutorial: Create a calculator REST API with three integrations 115 Amazon API Gateway Developer Guide "validateRequestBody": true }, "Validate query string parameters and headers": { "validateRequestParameters": true, "validateRequestBody": false } } } Tutorial: Create a REST API as an Amazon S3 proxy As an example to showcase using a REST API in API Gateway to proxy Amazon S3, this section describes how to create and configure a REST API to expose the following Amazon S3 operations: • Expose GET on the API's root resource to list all of the Amazon S3 buckets of a caller. • Expose GET on a Folder resource to view a list of all of the objects in an Amazon S3 bucket. • Expose GET on a Folder/Item resource to view or download an object from an Amazon S3 bucket. You might want to import the sample API as an Amazon S3 proxy, as shown in OpenAPI definitions of the sample API as an Amazon S3 proxy. This sample contains more exposed methods. For instructions on how to import an API using the OpenAPI definition, see Develop REST APIs using OpenAPI in API Gateway. Note To integrate your API Gateway API with Amazon S3, you must choose a region where both the API Gateway and Amazon S3 services are available. For region availability, see Amazon API Gateway Endpoints and Quotas. Topics • Set up IAM permissions for the API to invoke Amazon S3 actions • Create API resources to represent Amazon S3 resources • Expose an API method to list the caller's Amazon S3 buckets • Expose API methods to access an Amazon S3 bucket • Expose API methods to access an Amazon S3 object in a bucket Tutorial: Create a REST API as an Amazon S3 proxy 116 Amazon API Gateway Developer Guide • OpenAPI definitions of the sample API as an Amazon S3 proxy • Call the API using a REST API client Set up IAM permissions for the API to invoke Amazon S3 actions To allow the API to invoke Amazon S3 actions, you must have the appropriate IAM policies attached to an IAM role. In this step, you create a new IAM role. To create the AWS service proxy execution role 1. Sign in to the AWS Management Console and |
apigateway-dg-038 | apigateway-dg.pdf | 38 | object in a bucket Tutorial: Create a REST API as an Amazon S3 proxy 116 Amazon API Gateway Developer Guide • OpenAPI definitions of the sample API as an Amazon S3 proxy • Call the API using a REST API client Set up IAM permissions for the API to invoke Amazon S3 actions To allow the API to invoke Amazon S3 actions, you must have the appropriate IAM policies attached to an IAM role. In this step, you create a new IAM role. To create the AWS service proxy execution role 1. Sign in to the AWS Management Console and open the IAM console at https:// console.aws.amazon.com/iam/. 2. Choose Roles. 3. Choose Create role. 4. Choose AWS service under Select type of trusted entity, and then select API Gateway and select Allows API Gateway to push logs to CloudWatch Logs. 5. Choose Next, and then choose Next. 6. 7. For Role name, enter APIGatewayS3ProxyPolicy, and then choose Create role. In the Roles list, choose the role you just created. You may need to scroll or use the search bar to find the role. 8. For the selected role, select the Add permissions tab. 9. Choose Attach policies from the dropdown list. 10. In the search bar, enter AmazonS3FullAccess and choose Add permissions. Note This tutorial uses a managed policy for simplicity. As a best practice, you should create your own IAM policy to grant the minimum permissions required. 11. Note the newly created Role ARN, you will use it later. Create API resources to represent Amazon S3 resources You use the API's root (/) resource as the container of an authenticated caller's Amazon S3 buckets. You also create a Folder and Item resources to represent a particular Amazon S3 bucket and a Tutorial: Create a REST API as an Amazon S3 proxy 117 Amazon API Gateway Developer Guide particular Amazon S3 object, respectively. The folder name and object key will be specified, in the form of path parameters as part of a request URL, by the caller. Note When accessing objects whose object key includes / or any other special character, the character needs to be URL encoded. For example, test/test.txt should be encoded to test%2Ftest.txt. To create an API resource that exposes the Amazon S3 service features 1. In the same AWS Region you created your Amazon S3 bucket, create an API named MyS3. This API's root resource (/) represents the Amazon S3 service. In this step, you create two additional resources /{folder} and /{item}. 2. Choose Create resource. 3. Keep Proxy resource turned off. 4. 5. For Resource path, select /. For Resource name, enter {folder}. 6. Keep CORS (Cross Origin Resource Sharing) unchecked. 7. Choose Create resource. 8. Select the /{folder} resource, and then choose Create resource. 9. Use the previous steps to create a child resource of /{folder} named {item}. Your final API should look similar to the following: Tutorial: Create a REST API as an Amazon S3 proxy 118 Amazon API Gateway Developer Guide Expose an API method to list the caller's Amazon S3 buckets Getting the list of Amazon S3 buckets of the caller involves invoking the GET Service action on Amazon S3. On the API's root resource, (/), create the GET method. Configure the GET method to integrate with the Amazon S3, as follows. To create and initialize the API's GET / method 1. 2. 3. 4. 5. Select the / resource, and then choose Create method. For method type, select GET. For Integration type, select AWS service. For AWS Region, select the AWS Region where you created your Amazon S3 bucket. For AWS service, select Amazon Simple Storage Service. 6. Keep AWS subdomain blank. 7. 8. For HTTP method, select GET. For Action type, select Use path override. With path override, API Gateway forwards the client request to Amazon S3 as the corresponding Amazon S3 REST API path-style request, in which a Amazon S3 resource is expressed by the resource path of the s3-host-name/bucket/key pattern. API Gateway sets the s3-host-name and passes the client specified bucket and key from the client to Amazon S3. 9. For Path override, enter /. Tutorial: Create a REST API as an Amazon S3 proxy 119 Amazon API Gateway Developer Guide 10. For Execution role, enter the role ARN for APIGatewayS3ProxyPolicy. 11. Choose Method request settings. You use the method request settings to control who can call this method of your API. 12. For Authorization, from the dropdown menu, select AWS_IAM. 13. Choose Create method. This setup integrates the frontend GET https://your-api-host/stage/ request with the backend GET https://your-s3-host/. For your API to return successful responses and exceptions properly to the caller, you declare the 200, 400 and 500 responses in Method response. You use the default mapping for 200 responses so that backend responses of the status |
apigateway-dg-039 | apigateway-dg.pdf | 39 | API Gateway Developer Guide 10. For Execution role, enter the role ARN for APIGatewayS3ProxyPolicy. 11. Choose Method request settings. You use the method request settings to control who can call this method of your API. 12. For Authorization, from the dropdown menu, select AWS_IAM. 13. Choose Create method. This setup integrates the frontend GET https://your-api-host/stage/ request with the backend GET https://your-s3-host/. For your API to return successful responses and exceptions properly to the caller, you declare the 200, 400 and 500 responses in Method response. You use the default mapping for 200 responses so that backend responses of the status code not declared here will be returned to the caller as 200 ones. To declare response types for the GET / method 1. On the Method response tab, under Response 200, choose Edit. 2. Choose Add header and do the following: a. For Header name, enter Content-Type. b. Choose Add header. Tutorial: Create a REST API as an Amazon S3 proxy 120 Amazon API Gateway Developer Guide Repeat these steps to create a Timestamp header and a Content-Length header. 3. Choose Save. 4. On the Method response tab, under Method responses, choose Create response. 5. For HTTP status code, enter 400. You do not set any headers for this response. 6. Choose Save. 7. Repeat the following steps to create the 500 response. You do not set any headers for this response. Because the successful integration response from Amazon S3 returns the bucket list as an XML payload and the default method response from API Gateway returns a JSON payload, you must map the backend Content-Type header parameter value to the frontend counterpart. Otherwise, the client will receive application/json for the content type when the response body is actually an XML string. The following procedure shows how to set this up. In addition, you also want to display to the client other header parameters, such as Date and Content-Length. To set up response header mappings for the GET / method 1. On the Integration response tab, under Default - Response, choose Edit. 2. 3. 4. For the Content-Length header, enter integration.response.header.Content-Length for the mapping value. For the Content-Type header, enter integration.response.header.Content-Type for the mapping value. For the Timestamp header, enter integration.response.header.Date for the mapping value. 5. Choose Save. The result should look similar to the following: Tutorial: Create a REST API as an Amazon S3 proxy 121 Amazon API Gateway Developer Guide 6. On the Integration response tab, under Integration responses, choose Create response. 7. For HTTP status regex, enter 4\d{2}. This maps all 4xx HTTP response status codes to the method response. 8. For Method response status code, select 400. 9. Choose Create. 10. Repeat the following steps to create an integration response for the 500 method response. For HTTP status regex, enter 5\d{2}. Tutorial: Create a REST API as an Amazon S3 proxy 122 Amazon API Gateway Developer Guide As a good practice, you can test the API you have configured so far. To test the GET / method 1. Choose the Test tab. You might need to choose the right arrow button to show the tab. 2. Choose Test. The result should look like the following image: Expose API methods to access an Amazon S3 bucket To work with an Amazon S3 bucket, you expose the GET method on the /{folder} resource to list objects in a bucket. The instructions are similar to those described in Expose an API method to list the caller's Amazon S3 buckets. For more methods, you can import the sample API here, OpenAPI definitions of the sample API as an Amazon S3 proxy. Tutorial: Create a REST API as an Amazon S3 proxy 123 Amazon API Gateway Developer Guide To expose the GET method on a folder resource 1. 2. 3. 4. 5. Select the /{folder} resource, and then choose Create method. For method type, select GET. For Integration type, select AWS service. For AWS Region, select the AWS Region where you created your Amazon S3 bucket. For AWS service, select Amazon Simple Storage Service. 6. Keep AWS subdomain blank. 7. 8. 9. For HTTP method, select GET. For Action type, select Use path override. For Path override, enter {bucket}. 10. For Execution role, enter the role ARN for APIGatewayS3ProxyPolicy. 11. Choose Create method. You set the {folder} path parameter in the Amazon S3 endpoint URL. You need to map the {folder} path parameter of the method request to the {bucket} path parameter of the integration request. To map {folder} to {bucket} 1. On the Integration request tab, under Integration request settings, choose Edit. 2. Choose URL path parameters, and then choose Add path parameter. 3. 4. For Name, enter bucket. For Mapped from, enter method.request.path.folder. 5. Choose Save. Now, you test your API. To test the /{folder} GET method. 1. Choose |
apigateway-dg-040 | apigateway-dg.pdf | 40 | Execution role, enter the role ARN for APIGatewayS3ProxyPolicy. 11. Choose Create method. You set the {folder} path parameter in the Amazon S3 endpoint URL. You need to map the {folder} path parameter of the method request to the {bucket} path parameter of the integration request. To map {folder} to {bucket} 1. On the Integration request tab, under Integration request settings, choose Edit. 2. Choose URL path parameters, and then choose Add path parameter. 3. 4. For Name, enter bucket. For Mapped from, enter method.request.path.folder. 5. Choose Save. Now, you test your API. To test the /{folder} GET method. 1. Choose the Test tab. You might need to choose the right arrow button to show the tab. 2. Under Path, for folder, enter the name of your bucket. 3. Choose Test. Tutorial: Create a REST API as an Amazon S3 proxy 124 Amazon API Gateway Developer Guide The test result will contain a list of object in your bucket. Expose API methods to access an Amazon S3 object in a bucket Amazon S3 supports GET, DELETE, HEAD, OPTIONS, POST and PUT actions to access and manage objects in a given bucket. In this tutorial, you expose a GET method on the {folder}/{item} resource to get an image from a bucket. For more applications of the {folder}/{item} resource, see the sample API, OpenAPI definitions of the sample API as an Amazon S3 proxy. To expose the GET method on a item resource 1. 2. 3. Select the /{item} resource, and then choose Create method. For method type, select GET. For Integration type, select AWS service. Tutorial: Create a REST API as an Amazon S3 proxy 125 Amazon API Gateway Developer Guide 4. 5. For AWS Region, select the AWS Region where you created your Amazon S3 bucket. For AWS service, select Amazon Simple Storage Service. 6. Keep AWS subdomain blank. 7. 8. 9. For HTTP method, select GET. For Action type, select Use path override. For Path override, enter {bucket}/{object}. 10. For Execution role, enter the role ARN for APIGatewayS3ProxyPolicy. 11. Choose Create method. You set the {folder} and {item} path parameters in the Amazon S3 endpoint URL. You need to map the path parameter of the method request to the path parameter of the integration request. In this step, you do the following: • Map the {folder} path parameter of the method request to the {bucket} path parameter of the integration request. • Map the {item} path parameter of the method request to the {object} path parameter of the integration request. To map {folder} to {bucket} and {item} to {object} 1. On the Integration request tab, under Integration request settings, choose Edit. 2. Choose URL path parameters. 3. Choose Add path parameter. 4. 5. For Name, enter bucket. For Mapped from, enter method.request.path.folder. 6. Choose Add path parameter. 7. 8. For Name, enter object. For Mapped from, enter method.request.path.item. 9. Choose Save. To test the /{folder}/{object} GET method. 1. Choose the Test tab. You might need to choose the right arrow button to show the tab. Tutorial: Create a REST API as an Amazon S3 proxy 126 Amazon API Gateway Developer Guide 2. Under Path, for folder, enter the name of your bucket. 3. Under Path, for item, enter the name of an item. 4. Choose Test. The response body will contain the contents of the item. The request correctly returns the plain text of ("Hello world") as the content of the specified file (test.txt) in the given Amazon S3 bucket (amzn-s3-demo-bucket). To download or upload binary files, which in API Gateway is considered any thing other than utf-8 encoded JSON content, additional API settings are necessary. This is outlined as follows: Tutorial: Create a REST API as an Amazon S3 proxy 127 Amazon API Gateway Developer Guide To download or upload binary files from S3 1. Register the media types of the affected file to the API's binaryMediaTypes. You can do this in the console: a. Choose API settings for the API. b. Under Binary media types, choose Manage media types. c. Choose Add binary media type, and then enter the required media type, for example, image/png. d. Choose Save changes to save the setting. 2. Add the Content-Type (for upload) and/or Accept (for download) header to the method request to require the client to specify the required binary media type and map them to the integration request. 3. Set Content Handling to Passthrough in the integration request (for upload) and in a integration response (for download). Make sure that no mapping template is defined for the affected content type. For more information, see the section called “Data transformations”. The payload size limit is 10 MB. See Quotas for configuring and running a REST API in API Gateway. Make sure that files on Amazon S3 have the correct content types |
apigateway-dg-041 | apigateway-dg.pdf | 41 | upload) and/or Accept (for download) header to the method request to require the client to specify the required binary media type and map them to the integration request. 3. Set Content Handling to Passthrough in the integration request (for upload) and in a integration response (for download). Make sure that no mapping template is defined for the affected content type. For more information, see the section called “Data transformations”. The payload size limit is 10 MB. See Quotas for configuring and running a REST API in API Gateway. Make sure that files on Amazon S3 have the correct content types added as the files' metadata. For streamable media content, Content-Disposition:inline may also need to be added to the metadata. For more information about the binary support in API Gateway, see Content type conversions in API Gateway. OpenAPI definitions of the sample API as an Amazon S3 proxy The following OpenAPI definitions describes an API that works as an Amazon S3 proxy. This API contains more Amazon S3 operations than the API you created in the tutorial. The following methods are exposed in the OpenAPI definitions: • Expose GET on the API's root resource to list all of the Amazon S3 buckets of a caller. • Expose GET on a Folder resource to view a list of all of the objects in an Amazon S3 bucket. • Expose PUT on a Folder resource to add a bucket to Amazon S3. • Expose DELETE on a Folder resource to remove a bucket from Amazon S3. • Expose GET on a Folder/Item resource to view or download an object from an Amazon S3 bucket. Tutorial: Create a REST API as an Amazon S3 proxy 128 Amazon API Gateway Developer Guide • Expose PUT on a Folder/Item resource to upload an object to an Amazon S3 bucket. • Expose HEAD on a Folder/Item resource to get object metadata in an Amazon S3 bucket. • Expose DELETE on a Folder/Item resource to remove an object from an Amazon S3 bucket. For instructions on how to import an API using the OpenAPI definition, see Develop REST APIs using OpenAPI in API Gateway. For instructions on how to create a similar API, see Tutorial: Create a REST API as an Amazon S3 proxy. To learn how to invoke this API using Postman, which supports the AWS IAM authorization, see Call the API using a REST API client. OpenAPI 2.0 { "swagger": "2.0", "info": { "version": "2016-10-13T23:04:43Z", "title": "MyS3" }, "host": "9gn28ca086.execute-api.{region}.amazonaws.com", "basePath": "/S3", "schemes": [ "https" ], "paths": { "/": { "get": { "produces": [ "application/json" ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Empty" }, "headers": { "Content-Length": { "type": "string" }, Tutorial: Create a REST API as an Amazon S3 proxy 129 Amazon API Gateway Developer Guide "Timestamp": { "type": "string" }, "Content-Type": { "type": "string" } } }, "400": { "description": "400 response" }, "500": { "description": "500 response" } }, "security": [ { "sigv4": [] } ], "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "responses": { "4\\d{2}": { "statusCode": "400" }, "default": { "statusCode": "200", "responseParameters": { "method.response.header.Content-Type": "integration.response.header.Content-Type", "method.response.header.Content-Length": "integration.response.header.Content-Length", "method.response.header.Timestamp": "integration.response.header.Date" } }, "5\\d{2}": { "statusCode": "500" } }, "uri": "arn:aws:apigateway:us-west-2:s3:path//", "passthroughBehavior": "when_no_match", "httpMethod": "GET", Tutorial: Create a REST API as an Amazon S3 proxy 130 Developer Guide Amazon API Gateway "type": "aws" } } }, "/{folder}": { "get": { "produces": [ "application/json" ], "parameters": [ { "name": "folder", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Empty" }, "headers": { "Content-Length": { "type": "string" }, "Date": { "type": "string" }, "Content-Type": { "type": "string" } } }, "400": { "description": "400 response" }, "500": { "description": "500 response" } }, "security": [ { Tutorial: Create a REST API as an Amazon S3 proxy 131 Amazon API Gateway Developer Guide "sigv4": [] } ], "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "responses": { "4\\d{2}": { "statusCode": "400" }, "default": { "statusCode": "200", "responseParameters": { "method.response.header.Content-Type": "integration.response.header.Content-Type", "method.response.header.Date": "integration.response.header.Date", "method.response.header.Content-Length": "integration.response.header.content-length" } }, "5\\d{2}": { "statusCode": "500" } }, "requestParameters": { "integration.request.path.bucket": "method.request.path.folder" }, "uri": "arn:aws:apigateway:us-west-2:s3:path/{bucket}", "passthroughBehavior": "when_no_match", "httpMethod": "GET", "type": "aws" } }, "put": { "produces": [ "application/json" ], "parameters": [ { "name": "Content-Type", "in": "header", "required": false, "type": "string" }, { Tutorial: Create a REST API as an Amazon S3 proxy 132 Amazon API Gateway Developer Guide "name": "folder", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Empty" }, "headers": { "Content-Length": { "type": "string" }, "Content-Type": { "type": "string" } } }, "400": { "description": "400 response" }, "500": { "description": "500 response" } }, "security": [ { "sigv4": [] } ], "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "responses": { "4\\d{2}": { "statusCode": "400" }, "default": { "statusCode": "200", "responseParameters": { "method.response.header.Content-Type": "integration.response.header.Content-Type", Tutorial: |
apigateway-dg-042 | apigateway-dg.pdf | 42 | "in": "header", "required": false, "type": "string" }, { Tutorial: Create a REST API as an Amazon S3 proxy 132 Amazon API Gateway Developer Guide "name": "folder", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Empty" }, "headers": { "Content-Length": { "type": "string" }, "Content-Type": { "type": "string" } } }, "400": { "description": "400 response" }, "500": { "description": "500 response" } }, "security": [ { "sigv4": [] } ], "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "responses": { "4\\d{2}": { "statusCode": "400" }, "default": { "statusCode": "200", "responseParameters": { "method.response.header.Content-Type": "integration.response.header.Content-Type", Tutorial: Create a REST API as an Amazon S3 proxy 133 Amazon API Gateway Developer Guide "method.response.header.Content-Length": "integration.response.header.Content-Length" } }, "5\\d{2}": { "statusCode": "500" } }, "requestParameters": { "integration.request.path.bucket": "method.request.path.folder", "integration.request.header.Content-Type": "method.request.header.Content-Type" }, "uri": "arn:aws:apigateway:us-west-2:s3:path/{bucket}", "passthroughBehavior": "when_no_match", "httpMethod": "PUT", "type": "aws" } }, "delete": { "produces": [ "application/json" ], "parameters": [ { "name": "folder", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Empty" }, "headers": { "Date": { "type": "string" }, "Content-Type": { "type": "string" } Tutorial: Create a REST API as an Amazon S3 proxy 134 Amazon API Gateway Developer Guide } }, "400": { "description": "400 response" }, "500": { "description": "500 response" } }, "security": [ { "sigv4": [] } ], "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "responses": { "4\\d{2}": { "statusCode": "400" }, "default": { "statusCode": "200", "responseParameters": { "method.response.header.Content-Type": "integration.response.header.Content-Type", "method.response.header.Date": "integration.response.header.Date" } }, "5\\d{2}": { "statusCode": "500" } }, "requestParameters": { "integration.request.path.bucket": "method.request.path.folder" }, "uri": "arn:aws:apigateway:us-west-2:s3:path/{bucket}", "passthroughBehavior": "when_no_match", "httpMethod": "DELETE", "type": "aws" } } }, "/{folder}/{item}": { "get": { Tutorial: Create a REST API as an Amazon S3 proxy 135 Amazon API Gateway Developer Guide "produces": [ "application/json" ], "parameters": [ { "name": "item", "in": "path", "required": true, "type": "string" }, { "name": "folder", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Empty" }, "headers": { "content-type": { "type": "string" }, "Content-Type": { "type": "string" } } }, "400": { "description": "400 response" }, "500": { "description": "500 response" } }, "security": [ { "sigv4": [] } ], Tutorial: Create a REST API as an Amazon S3 proxy 136 Amazon API Gateway Developer Guide "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "responses": { "4\\d{2}": { "statusCode": "400" }, "default": { "statusCode": "200", "responseParameters": { "method.response.header.content-type": "integration.response.header.content-type", "method.response.header.Content-Type": "integration.response.header.Content-Type" } }, "5\\d{2}": { "statusCode": "500" } }, "requestParameters": { "integration.request.path.object": "method.request.path.item", "integration.request.path.bucket": "method.request.path.folder" }, "uri": "arn:aws:apigateway:us-west-2:s3:path/{bucket}/{object}", "passthroughBehavior": "when_no_match", "httpMethod": "GET", "type": "aws" } }, "head": { "produces": [ "application/json" ], "parameters": [ { "name": "item", "in": "path", "required": true, "type": "string" }, { "name": "folder", "in": "path", "required": true, Tutorial: Create a REST API as an Amazon S3 proxy 137 Amazon API Gateway Developer Guide "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Empty" }, "headers": { "Content-Length": { "type": "string" }, "Content-Type": { "type": "string" } } }, "400": { "description": "400 response" }, "500": { "description": "500 response" } }, "security": [ { "sigv4": [] } ], "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "responses": { "4\\d{2}": { "statusCode": "400" }, "default": { "statusCode": "200", "responseParameters": { "method.response.header.Content-Type": "integration.response.header.Content-Type", "method.response.header.Content-Length": "integration.response.header.Content-Length" } Tutorial: Create a REST API as an Amazon S3 proxy 138 Amazon API Gateway }, "5\\d{2}": { "statusCode": "500" } }, "requestParameters": { Developer Guide "integration.request.path.object": "method.request.path.item", "integration.request.path.bucket": "method.request.path.folder" }, "uri": "arn:aws:apigateway:us-west-2:s3:path/{bucket}/{object}", "passthroughBehavior": "when_no_match", "httpMethod": "HEAD", "type": "aws" } }, "put": { "produces": [ "application/json" ], "parameters": [ { "name": "Content-Type", "in": "header", "required": false, "type": "string" }, { "name": "item", "in": "path", "required": true, "type": "string" }, { "name": "folder", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Empty" Tutorial: Create a REST API as an Amazon S3 proxy 139 Developer Guide Amazon API Gateway }, "headers": { "Content-Length": { "type": "string" }, "Content-Type": { "type": "string" } } }, "400": { "description": "400 response" }, "500": { "description": "500 response" } }, "security": [ { "sigv4": [] } ], "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "responses": { "4\\d{2}": { "statusCode": "400" }, "default": { "statusCode": "200", "responseParameters": { "method.response.header.Content-Type": "integration.response.header.Content-Type", "method.response.header.Content-Length": "integration.response.header.Content-Length" } }, "5\\d{2}": { "statusCode": "500" } }, "requestParameters": { "integration.request.path.object": "method.request.path.item", "integration.request.path.bucket": "method.request.path.folder", Tutorial: Create a REST API as an Amazon S3 proxy 140 Amazon API Gateway Developer Guide "integration.request.header.Content-Type": "method.request.header.Content-Type" }, "uri": "arn:aws:apigateway:us-west-2:s3:path/{bucket}/{object}", "passthroughBehavior": "when_no_match", "httpMethod": "PUT", "type": "aws" } }, "delete": { "produces": [ "application/json" ], "parameters": [ { "name": "item", "in": "path", "required": true, "type": "string" }, { "name": "folder", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Empty" }, "headers": { "Content-Length": { "type": "string" }, "Content-Type": { "type": "string" } } }, "400": { "description": "400 |
apigateway-dg-043 | apigateway-dg.pdf | 43 | "5\\d{2}": { "statusCode": "500" } }, "requestParameters": { "integration.request.path.object": "method.request.path.item", "integration.request.path.bucket": "method.request.path.folder", Tutorial: Create a REST API as an Amazon S3 proxy 140 Amazon API Gateway Developer Guide "integration.request.header.Content-Type": "method.request.header.Content-Type" }, "uri": "arn:aws:apigateway:us-west-2:s3:path/{bucket}/{object}", "passthroughBehavior": "when_no_match", "httpMethod": "PUT", "type": "aws" } }, "delete": { "produces": [ "application/json" ], "parameters": [ { "name": "item", "in": "path", "required": true, "type": "string" }, { "name": "folder", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Empty" }, "headers": { "Content-Length": { "type": "string" }, "Content-Type": { "type": "string" } } }, "400": { "description": "400 response" Tutorial: Create a REST API as an Amazon S3 proxy 141 Amazon API Gateway }, "500": { "description": "500 response" } }, "security": [ { "sigv4": [] } ], Developer Guide "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012:role/apigAwsProxyRole", "responses": { "4\\d{2}": { "statusCode": "400" }, "default": { "statusCode": "200" }, "5\\d{2}": { "statusCode": "500" } }, "requestParameters": { "integration.request.path.object": "method.request.path.item", "integration.request.path.bucket": "method.request.path.folder" }, "uri": "arn:aws:apigateway:us-west-2:s3:path/{bucket}/{object}", "passthroughBehavior": "when_no_match", "httpMethod": "DELETE", "type": "aws" } } } }, "securityDefinitions": { "sigv4": { "type": "apiKey", "name": "Authorization", "in": "header", "x-amazon-apigateway-authtype": "awsSigv4" } }, "definitions": { Tutorial: Create a REST API as an Amazon S3 proxy 142 Amazon API Gateway Developer Guide "Empty": { "type": "object", "title": "Empty Schema" } } } OpenAPI 3.0 { "openapi" : "3.0.1", "info" : { "title" : "MyS3", "version" : "2016-10-13T23:04:43Z" }, "servers" : [ { "url" : "https://9gn28ca086.execute-api.{region}.amazonaws.com/{basePath}", "variables" : { "basePath" : { "default" : "S3" } } } ], "paths" : { "/{folder}" : { "get" : { "parameters" : [ { "name" : "folder", "in" : "path", "required" : true, "schema" : { "type" : "string" } } ], "responses" : { "400" : { "description" : "400 response", "content" : { } }, "500" : { "description" : "500 response", "content" : { } }, Tutorial: Create a REST API as an Amazon S3 proxy 143 Developer Guide Amazon API Gateway "200" : { "description" : "200 response", "headers" : { "Content-Length" : { "schema" : { "type" : "string" } }, "Date" : { "schema" : { "type" : "string" } }, "Content-Type" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Empty" } } } } }, "x-amazon-apigateway-integration" : { "credentials" : "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod" : "GET", "uri" : "arn:aws:apigateway:us-west-2:s3:path/{bucket}", "responses" : { "4\\d{2}" : { "statusCode" : "400" }, "default" : { "statusCode" : "200", "responseParameters" : { "method.response.header.Content-Type" : "integration.response.header.Content-Type", "method.response.header.Date" : "integration.response.header.Date", "method.response.header.Content-Length" : "integration.response.header.content-length" Tutorial: Create a REST API as an Amazon S3 proxy 144 Amazon API Gateway Developer Guide } }, "5\\d{2}" : { "statusCode" : "500" } }, "requestParameters" : { "integration.request.path.bucket" : "method.request.path.folder" }, "passthroughBehavior" : "when_no_match", "type" : "aws" } }, "put" : { "parameters" : [ { "name" : "Content-Type", "in" : "header", "schema" : { "type" : "string" } }, { "name" : "folder", "in" : "path", "required" : true, "schema" : { "type" : "string" } } ], "responses" : { "400" : { "description" : "400 response", "content" : { } }, "500" : { "description" : "500 response", "content" : { } }, "200" : { "description" : "200 response", "headers" : { "Content-Length" : { "schema" : { "type" : "string" } Tutorial: Create a REST API as an Amazon S3 proxy 145 Amazon API Gateway Developer Guide }, "Content-Type" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Empty" } } } } }, "x-amazon-apigateway-integration" : { "credentials" : "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod" : "PUT", "uri" : "arn:aws:apigateway:us-west-2:s3:path/{bucket}", "responses" : { "4\\d{2}" : { "statusCode" : "400" }, "default" : { "statusCode" : "200", "responseParameters" : { "method.response.header.Content-Type" : "integration.response.header.Content-Type", "method.response.header.Content-Length" : "integration.response.header.Content-Length" } }, "5\\d{2}" : { "statusCode" : "500" } }, "requestParameters" : { "integration.request.path.bucket" : "method.request.path.folder", "integration.request.header.Content-Type" : "method.request.header.Content-Type" }, "passthroughBehavior" : "when_no_match", "type" : "aws" Tutorial: Create a REST API as an Amazon S3 proxy 146 Amazon API Gateway Developer Guide } }, "delete" : { "parameters" : [ { "name" : "folder", "in" : "path", "required" : true, "schema" : { "type" : "string" } } ], "responses" : { "400" : { "description" : "400 response", "content" : { } }, "500" : { "description" : "500 response", "content" : { } }, "200" : { "description" : "200 response", "headers" : { "Date" : { "schema" : { "type" : "string" } }, "Content-Type" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Empty" } } } } }, "x-amazon-apigateway-integration" : { Tutorial: Create a REST API as an Amazon S3 proxy 147 Amazon API Gateway |
apigateway-dg-044 | apigateway-dg.pdf | 44 | "type" : "string" } } ], "responses" : { "400" : { "description" : "400 response", "content" : { } }, "500" : { "description" : "500 response", "content" : { } }, "200" : { "description" : "200 response", "headers" : { "Date" : { "schema" : { "type" : "string" } }, "Content-Type" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Empty" } } } } }, "x-amazon-apigateway-integration" : { Tutorial: Create a REST API as an Amazon S3 proxy 147 Amazon API Gateway Developer Guide "credentials" : "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod" : "DELETE", "uri" : "arn:aws:apigateway:us-west-2:s3:path/{bucket}", "responses" : { "4\\d{2}" : { "statusCode" : "400" }, "default" : { "statusCode" : "200", "responseParameters" : { "method.response.header.Content-Type" : "integration.response.header.Content-Type", "method.response.header.Date" : "integration.response.header.Date" } }, "5\\d{2}" : { "statusCode" : "500" } }, "requestParameters" : { "integration.request.path.bucket" : "method.request.path.folder" }, "passthroughBehavior" : "when_no_match", "type" : "aws" } } }, "/{folder}/{item}" : { "get" : { "parameters" : [ { "name" : "item", "in" : "path", "required" : true, "schema" : { "type" : "string" } }, { "name" : "folder", "in" : "path", "required" : true, "schema" : { "type" : "string" } } ], Tutorial: Create a REST API as an Amazon S3 proxy 148 Amazon API Gateway Developer Guide "responses" : { "400" : { "description" : "400 response", "content" : { } }, "500" : { "description" : "500 response", "content" : { } }, "200" : { "description" : "200 response", "headers" : { "content-type" : { "schema" : { "type" : "string" } }, "Content-Type" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Empty" } } } } }, "x-amazon-apigateway-integration" : { "credentials" : "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod" : "GET", "uri" : "arn:aws:apigateway:us-west-2:s3:path/{bucket}/{object}", "responses" : { "4\\d{2}" : { "statusCode" : "400" }, "default" : { "statusCode" : "200", "responseParameters" : { Tutorial: Create a REST API as an Amazon S3 proxy 149 Amazon API Gateway Developer Guide "method.response.header.content-type" : "integration.response.header.content-type", "method.response.header.Content-Type" : "integration.response.header.Content-Type" } }, "5\\d{2}" : { "statusCode" : "500" } }, "requestParameters" : { "integration.request.path.object" : "method.request.path.item", "integration.request.path.bucket" : "method.request.path.folder" }, "passthroughBehavior" : "when_no_match", "type" : "aws" } }, "put" : { "parameters" : [ { "name" : "Content-Type", "in" : "header", "schema" : { "type" : "string" } }, { "name" : "item", "in" : "path", "required" : true, "schema" : { "type" : "string" } }, { "name" : "folder", "in" : "path", "required" : true, "schema" : { "type" : "string" } } ], "responses" : { "400" : { "description" : "400 response", "content" : { } Tutorial: Create a REST API as an Amazon S3 proxy 150 Developer Guide Amazon API Gateway }, "500" : { "description" : "500 response", "content" : { } }, "200" : { "description" : "200 response", "headers" : { "Content-Length" : { "schema" : { "type" : "string" } }, "Content-Type" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Empty" } } } } }, "x-amazon-apigateway-integration" : { "credentials" : "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod" : "PUT", "uri" : "arn:aws:apigateway:us-west-2:s3:path/{bucket}/{object}", "responses" : { "4\\d{2}" : { "statusCode" : "400" }, "default" : { "statusCode" : "200", "responseParameters" : { "method.response.header.Content-Type" : "integration.response.header.Content-Type", "method.response.header.Content-Length" : "integration.response.header.Content-Length" } Tutorial: Create a REST API as an Amazon S3 proxy 151 Amazon API Gateway }, "5\\d{2}" : { "statusCode" : "500" } }, "requestParameters" : { Developer Guide "integration.request.path.object" : "method.request.path.item", "integration.request.path.bucket" : "method.request.path.folder", "integration.request.header.Content-Type" : "method.request.header.Content-Type" }, "passthroughBehavior" : "when_no_match", "type" : "aws" } }, "delete" : { "parameters" : [ { "name" : "item", "in" : "path", "required" : true, "schema" : { "type" : "string" } }, { "name" : "folder", "in" : "path", "required" : true, "schema" : { "type" : "string" } } ], "responses" : { "400" : { "description" : "400 response", "content" : { } }, "500" : { "description" : "500 response", "content" : { } }, "200" : { "description" : "200 response", "headers" : { "Content-Length" : { Tutorial: Create a REST API as an Amazon S3 proxy 152 Amazon API Gateway Developer Guide "schema" : { "type" : "string" } }, "Content-Type" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Empty" } } } } }, "x-amazon-apigateway-integration" : { "credentials" : "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod" : "DELETE", "uri" : "arn:aws:apigateway:us-west-2:s3:path/{bucket}/{object}", "responses" : { "4\\d{2}" : { "statusCode" : "400" }, "default" : { "statusCode" : "200" }, "5\\d{2}" : { "statusCode" : "500" } }, "requestParameters" : { "integration.request.path.object" : "method.request.path.item", "integration.request.path.bucket" : "method.request.path.folder" }, |
apigateway-dg-045 | apigateway-dg.pdf | 45 | Tutorial: Create a REST API as an Amazon S3 proxy 152 Amazon API Gateway Developer Guide "schema" : { "type" : "string" } }, "Content-Type" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Empty" } } } } }, "x-amazon-apigateway-integration" : { "credentials" : "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod" : "DELETE", "uri" : "arn:aws:apigateway:us-west-2:s3:path/{bucket}/{object}", "responses" : { "4\\d{2}" : { "statusCode" : "400" }, "default" : { "statusCode" : "200" }, "5\\d{2}" : { "statusCode" : "500" } }, "requestParameters" : { "integration.request.path.object" : "method.request.path.item", "integration.request.path.bucket" : "method.request.path.folder" }, "passthroughBehavior" : "when_no_match", "type" : "aws" } }, "head" : { "parameters" : [ { Tutorial: Create a REST API as an Amazon S3 proxy 153 Amazon API Gateway Developer Guide "name" : "item", "in" : "path", "required" : true, "schema" : { "type" : "string" } }, { "name" : "folder", "in" : "path", "required" : true, "schema" : { "type" : "string" } } ], "responses" : { "400" : { "description" : "400 response", "content" : { } }, "500" : { "description" : "500 response", "content" : { } }, "200" : { "description" : "200 response", "headers" : { "Content-Length" : { "schema" : { "type" : "string" } }, "Content-Type" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Empty" } } } Tutorial: Create a REST API as an Amazon S3 proxy 154 Amazon API Gateway } Developer Guide }, "x-amazon-apigateway-integration" : { "credentials" : "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod" : "HEAD", "uri" : "arn:aws:apigateway:us-west-2:s3:path/{bucket}/{object}", "responses" : { "4\\d{2}" : { "statusCode" : "400" }, "default" : { "statusCode" : "200", "responseParameters" : { "method.response.header.Content-Type" : "integration.response.header.Content-Type", "method.response.header.Content-Length" : "integration.response.header.Content-Length" } }, "5\\d{2}" : { "statusCode" : "500" } }, "requestParameters" : { "integration.request.path.object" : "method.request.path.item", "integration.request.path.bucket" : "method.request.path.folder" }, "passthroughBehavior" : "when_no_match", "type" : "aws" } } }, "/" : { "get" : { "responses" : { "400" : { "description" : "400 response", "content" : { } }, "500" : { "description" : "500 response", "content" : { } }, "200" : { Tutorial: Create a REST API as an Amazon S3 proxy 155 Amazon API Gateway Developer Guide "description" : "200 response", "headers" : { "Content-Length" : { "schema" : { "type" : "string" } }, "Timestamp" : { "schema" : { "type" : "string" } }, "Content-Type" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Empty" } } } } }, "x-amazon-apigateway-integration" : { "credentials" : "arn:aws:iam::123456789012:role/apigAwsProxyRole", "httpMethod" : "GET", "uri" : "arn:aws:apigateway:us-west-2:s3:path//", "responses" : { "4\\d{2}" : { "statusCode" : "400" }, "default" : { "statusCode" : "200", "responseParameters" : { "method.response.header.Content-Type" : "integration.response.header.Content-Type", "method.response.header.Content-Length" : "integration.response.header.Content-Length", "method.response.header.Timestamp" : "integration.response.header.Date" Tutorial: Create a REST API as an Amazon S3 proxy 156 Amazon API Gateway Developer Guide } }, "5\\d{2}" : { "statusCode" : "500" } }, "passthroughBehavior" : "when_no_match", "type" : "aws" } } } }, "components" : { "schemas" : { "Empty" : { "title" : "Empty Schema", "type" : "object" } } } } Call the API using a REST API client To provide an end-to-end tutorial, we now show how to call the API using Postman, which supports the AWS IAM authorization. To call our Amazon S3 proxy API using Postman 1. Deploy or redeploy the API. Make a note of the base URL of the API that is displayed next to Invoke URL at the top of the Stage Editor. 2. Launch Postman. 3. Choose Authorization and then choose AWS Signature. Enter your IAM user's Access Key ID and Secret Access Key into the AccessKey and SecretKeyinput fields, respectively. Enter the AWS Region to which your API is deployed in the AWS Region text box. Enter execute-api in the Service Name input field. You can create a pair of the keys from the Security Credentials tab from your IAM user account in the IAM Management Console. Tutorial: Create a REST API as an Amazon S3 proxy 157 Amazon API Gateway Developer Guide 4. To add a bucket named amzn-s3-demo-bucket to your Amazon S3 account in the {region} region: a. Choose PUT from the drop-down method list and type the method URL (https://api- id.execute-api.aws-region.amazonaws.com/stage/folder-name b. Set the Content-Type header value as application/xml. You may need to delete any existing headers before setting the content type. c. Choose Body menu item and type the following XML fragment as the request body: <CreateBucketConfiguration> <LocationConstraint>{region}</LocationConstraint> </CreateBucketConfiguration> d. Choose Send to submit the request. If successful, you should receive a 200 OK response with an empty payload. 5. To add a text file to a bucket, follow the instructions above. If you specify a bucket |
apigateway-dg-046 | apigateway-dg.pdf | 46 | your Amazon S3 account in the {region} region: a. Choose PUT from the drop-down method list and type the method URL (https://api- id.execute-api.aws-region.amazonaws.com/stage/folder-name b. Set the Content-Type header value as application/xml. You may need to delete any existing headers before setting the content type. c. Choose Body menu item and type the following XML fragment as the request body: <CreateBucketConfiguration> <LocationConstraint>{region}</LocationConstraint> </CreateBucketConfiguration> d. Choose Send to submit the request. If successful, you should receive a 200 OK response with an empty payload. 5. To add a text file to a bucket, follow the instructions above. If you specify a bucket name of amzn-s3-demo-bucket for {folder} and a file name of Readme.txt for {item} in the URL and provide a text string of Hello, World! as the file contents (thereby making it the request payload), the request becomes PUT /S3/amzn-s3-demo-bucket/Readme.txt HTTP/1.1 Host: 9gn28ca086.execute-api.{region}.amazonaws.com Content-Type: application/xml X-Amz-Date: 20161015T062647Z Authorization: AWS4-HMAC-SHA256 Credential=access-key-id/20161015/{region}/execute- api/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date, Signature=ccadb877bdb0d395ca38cc47e18a0d76bb5eaf17007d11e40bf6fb63d28c705b Cache-Control: no-cache Postman-Token: 6135d315-9cc4-8af8-1757-90871d00847e Hello, World! If everything goes well, you should receive a 200 OK response with an empty payload. 6. To get the content of the Readme.txt file we just added to the amzn-s3-demo-bucket bucket, do a GET request like the following one: GET /S3/amzn-s3-demo-bucket/Readme.txt HTTP/1.1 Host: 9gn28ca086.execute-api.{region}.amazonaws.com Content-Type: application/xml Tutorial: Create a REST API as an Amazon S3 proxy 158 Amazon API Gateway Developer Guide X-Amz-Date: 20161015T063759Z Authorization: AWS4-HMAC-SHA256 Credential=access-key-id/20161015/{region}/ execute-api/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=ba09b72b585acf0e578e6ad02555c00e24b420b59025bc7bb8d3f7aed1471339 Cache-Control: no-cache Postman-Token: d60fcb59-d335-52f7-0025-5bd96928098a If successful, you should receive a 200 OK response with the Hello, World! text string as the payload. 7. To list items in the amzn-s3-demo-bucket bucket, submit the following request: GET /S3/amzn-s3-demo-bucket HTTP/1.1 Host: 9gn28ca086.execute-api.{region}.amazonaws.com Content-Type: application/xml X-Amz-Date: 20161015T064324Z Authorization: AWS4-HMAC-SHA256 Credential=access-key-id/20161015/{region}/ execute-api/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=4ac9bd4574a14e01568134fd16814534d9951649d3a22b3b0db9f1f5cd4dd0ac Cache-Control: no-cache Postman-Token: 9c43020a-966f-61e1-81af-4c49ad8d1392 If successful, you should receive a 200 OK response with an XML payload showing a single item in the specified bucket, unless you added more files to the bucket before submitting this request. <?xml version="1.0" encoding="UTF-8"?> <ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Name>apig-demo-5</Name> <Prefix></Prefix> <Marker></Marker> <MaxKeys>1000</MaxKeys> <IsTruncated>false</IsTruncated> <Contents> <Key>Readme.txt</Key> <LastModified>2016-10-15T06:26:48.000Z</LastModified> <ETag>"65a8e27d8879283831b664bd8b7f0ad4"</ETag> <Size>13</Size> <Owner> <ID>06e4b09e9d...603addd12ee</ID> <DisplayName>user-name</DisplayName> </Owner> Tutorial: Create a REST API as an Amazon S3 proxy 159 Amazon API Gateway Developer Guide <StorageClass>STANDARD</StorageClass> </Contents> </ListBucketResult> Note To upload or download an image, you need to set content handling to CONVERT_TO_BINARY. Tutorial: Create a REST API as an Amazon Kinesis proxy This page describes how to create and configure a REST API with an integration of the AWS type to access Kinesis. Note To integrate your API Gateway API with Kinesis, you must choose a region where both the API Gateway and Kinesis services are available. For region availability, see Service Endpoints and Quotas. For the purpose of illustration, we create an example API to enable a client to do the following: 1. List the user's available streams in Kinesis 2. Create, describe, or delete a specified stream 3. Read data records from or write data records into the specified stream To accomplish the preceding tasks, the API exposes methods on various resources to invoke the following, respectively: 1. The ListStreams action in Kinesis 2. The CreateStream, DescribeStream, or DeleteStream action 3. The GetRecords or PutRecords (including PutRecord) action in Kinesis Specifically, we build the API as follows: Tutorial: Create a REST API as an Amazon Kinesis proxy 160 Amazon API Gateway Developer Guide • Expose an HTTP GET method on the API's /streams resource and integrate the method with the ListStreams action in Kinesis to list the streams in the caller's account. • Expose an HTTP POST method on the API's /streams/{stream-name} resource and integrate the method with the CreateStream action in Kinesis to create a named stream in the caller's account. • Expose an HTTP GET method on the API's /streams/{stream-name} resource and integrate the method with the DescribeStream action in Kinesis to describe a named stream in the caller's account. • Expose an HTTP DELETE method on the API's /streams/{stream-name} resource and integrate the method with the DeleteStream action in Kinesis to delete a stream in the caller's account. • Expose an HTTP PUT method on the API's /streams/{stream-name}/record resource and integrate the method with the PutRecord action in Kinesis. This enables the client to add a single data record to the named stream. • Expose an HTTP PUT method on the API's /streams/{stream-name}/records resource and integrate the method with the PutRecords action in Kinesis. This enables the client to add a list of data records to the named stream. • Expose an HTTP GET method on the API's /streams/{stream-name}/records resource and integrate the method with the GetRecords action in Kinesis. This enables the client to list data records in the named stream, with a specified shard iterator. A shard iterator specifies the shard position from which to start reading data records sequentially. • Expose an HTTP GET method on the API's /streams/{stream-name}/sharditerator resource and integrate the method with the GetShardIterator |
apigateway-dg-047 | apigateway-dg.pdf | 47 | the API's /streams/{stream-name}/records resource and integrate the method with the PutRecords action in Kinesis. This enables the client to add a list of data records to the named stream. • Expose an HTTP GET method on the API's /streams/{stream-name}/records resource and integrate the method with the GetRecords action in Kinesis. This enables the client to list data records in the named stream, with a specified shard iterator. A shard iterator specifies the shard position from which to start reading data records sequentially. • Expose an HTTP GET method on the API's /streams/{stream-name}/sharditerator resource and integrate the method with the GetShardIterator action in Kinesis. This helper method must be supplied to the ListStreams action in Kinesis. You can apply the instructions presented here to other Kinesis actions. For the complete list of the Kinesis actions, see Amazon Kinesis API Reference. Instead of using the API Gateway console to create the sample API, you can import the sample API into API Gateway using the API Gateway Import API. For information on how to use the Import API, see Develop REST APIs using OpenAPI in API Gateway. Create an IAM role and policy for the API to access Kinesis To allow the API to invoke Kinesis actions, you must have the appropriate IAM policies attached to an IAM role. In this step, you create a new IAM role. Tutorial: Create a REST API as an Amazon Kinesis proxy 161 Amazon API Gateway Developer Guide To create the AWS service proxy execution role 1. Sign in to the AWS Management Console and open the IAM console at https:// console.aws.amazon.com/iam/. 2. Choose Roles. 3. Choose Create role. 4. Choose AWS service under Select type of trusted entity, and then select API Gateway and select Allows API Gateway to push logs to CloudWatch Logs. 5. Choose Next, and then choose Next. 6. 7. For Role name, enter APIGatewayKinesisProxyPolicy, and then choose Create role. In the Roles list, choose the role you just created. You may need to scroll or use the search bar to find the role. 8. For the selected role, select the Add permissions tab. 9. Choose Attach policies from the dropdown list. 10. In the search bar, enter AmazonKinesisFullAccess and choose Add permissions. Note This tutorial uses a managed policy for simplicity. As a best practice, you should create your own IAM policy to grant the minimum permissions required. 11. Note the newly created Role ARN, you will use it later. Create an API as a Kinesis proxy Use the following steps to create the API in the API Gateway console. To create an API as an AWS service proxy for Kinesis 1. 2. Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway. If this is your first time using API Gateway, you see a page that introduces you to the features of the service. Under REST API, choose Build. When the Create Example API popup appears, choose OK. If this is not your first time using API Gateway, choose Create API. Under REST API, choose Build. Tutorial: Create a REST API as an Amazon Kinesis proxy 162 Amazon API Gateway 3. Choose New API. Developer Guide 4. 5. 6. In API name, enter KinesisProxy. Keep the default values for all other fields. (Optional) For Description, enter a description. For IP address type, select IPv4. 7. Choose Create API. After the API is created, the API Gateway console displays the Resources page, which contains only the API's root (/) resource. List streams in Kinesis Kinesis supports the ListStreams action with the following REST API call: POST /?Action=ListStreams HTTP/1.1 Host: kinesis.<region>.<domain> Content-Length: <PayloadSizeBytes> User-Agent: <UserAgentString> Content-Type: application/x-amz-json-1.1 Authorization: <AuthParams> X-Amz-Date: <Date> { ... } In the above REST API request, the action is specified in the Action query parameter. Alternatively, you can specify the action in a X-Amz-Target header, instead: POST / HTTP/1.1 Host: kinesis.<region>.<domain> Content-Length: <PayloadSizeBytes> User-Agent: <UserAgentString> Content-Type: application/x-amz-json-1.1 Authorization: <AuthParams> X-Amz-Date: <Date> X-Amz-Target: Kinesis_20131202.ListStreams { ... } Tutorial: Create a REST API as an Amazon Kinesis proxy 163 Amazon API Gateway Developer Guide In this tutorial, we use the query parameter to specify action. To expose a Kinesis action in the API, add a /streams resource to the API's root. Then set a GET method on the resource and integrate the method with the ListStreams action of Kinesis. The following procedure describes how to list Kinesis streams by using the API Gateway console. To list Kinesis streams by using the API Gateway console 1. 2. Select the / resource, and then choose Create resource. For Resource name, enter streams. 3. Keep CORS (Cross Origin Resource Sharing) turned off. 4. Choose Create resource. 5. Choose the /streams resource, and then choose Create method, and then do the following: a. For Method type, select GET. Note The HTTP verb for a method invoked |
apigateway-dg-048 | apigateway-dg.pdf | 48 | set a GET method on the resource and integrate the method with the ListStreams action of Kinesis. The following procedure describes how to list Kinesis streams by using the API Gateway console. To list Kinesis streams by using the API Gateway console 1. 2. Select the / resource, and then choose Create resource. For Resource name, enter streams. 3. Keep CORS (Cross Origin Resource Sharing) turned off. 4. Choose Create resource. 5. Choose the /streams resource, and then choose Create method, and then do the following: a. For Method type, select GET. Note The HTTP verb for a method invoked by a client may differ from the HTTP verb for an integration required by the backend. We select GET here, because listing streams is intuitively a READ operation. b. c. d. For Integration type, select AWS service. For AWS Region, select the AWS Region where you created your Kinesis stream. For AWS service, select Kinesis. e. Keep AWS subdomain blank. f. For HTTP method, choose POST. Note We chose POST here because Kinesis requires that the ListStreams action be invoked with it. g. h. i. For Action type, choose Use action name. For Action name, enter ListStreams. For Execution role, enter the ARN for your execution role. Tutorial: Create a REST API as an Amazon Kinesis proxy 164 Amazon API Gateway Developer Guide j. k. Keep the default of Passthrough for Content Handling. Choose Create method. 6. On the Integration request tab, under Integration request settings, choose Edit. 7. For Request body passthrough, select When there are no templates defined (recommended). 8. Choose URL request headers parameters, and then do the following: a. b. c. Choose Add request headers parameter. For Name, enter Content-Type. For Mapped from, enter 'application/x-amz-json-1.1'. We use a request parameter mapping to set the Content-Type header to the static value of 'application/x-amz-json-1.1' to inform Kinesis that the input is of a specific version of JSON. 9. Choose Mapping templates, and then choose Add mapping template, and do the following: a. b. c. For Content-Type, enter application/json. For Template body, enter {}. Choose Save. The ListStreams request takes a payload of the following JSON format: { "ExclusiveStartStreamName": "string", "Limit": number } However, the properties are optional. To use the default values, we opted for an empty JSON payload here. 10. Test the GET method on the /streams resource to invoke the ListStreams action in Kinesis: Choose the Test tab. You might need to choose the right arrow button to show the tab. Choose Test to test your method. Tutorial: Create a REST API as an Amazon Kinesis proxy 165 Amazon API Gateway Developer Guide If you already created two streams named "myStream" and "yourStream" in Kinesis, the successful test returns a 200 OK response containing the following payload: { "HasMoreStreams": false, "StreamNames": [ "myStream", "yourStream" ] } Create, describe, and delete a stream in Kinesis Creating, describing, and deleting a stream in Kinesis involves making the following Kinesis REST API requests, respectively: POST /?Action=CreateStream HTTP/1.1 Host: kinesis.region.domain ... Content-Type: application/x-amz-json-1.1 Content-Length: PayloadSizeBytes { "ShardCount": number, "StreamName": "string" } POST /?Action=DescribeStream HTTP/1.1 Host: kinesis.region.domain ... Content-Type: application/x-amz-json-1.1 Content-Length: PayloadSizeBytes { "StreamName": "string" Tutorial: Create a REST API as an Amazon Kinesis proxy 166 Amazon API Gateway Developer Guide } POST /?Action=DeleteStream HTTP/1.1 Host: kinesis.region.domain ... Content-Type: application/x-amz-json-1.1 Content-Length: PayloadSizeBytes { "StreamName":"string" } We can build the API to accept the required input as a JSON payload of the method request and pass the payload through to the integration request. However, to provide more examples of data mapping between method and integration requests, and method and integration responses, we create our API somewhat differently. We expose the GET, POST, and Delete HTTP methods on a to-be-named Stream resource. We use the {stream-name} path variable as the placeholder of the stream resource and integrate these API methods with the Kinesis' DescribeStream, CreateStream, and DeleteStream actions, respectively. We require that the client pass other input data as headers, query parameters, or the payload of a method request. We provide mapping templates to transform the data to the required integration request payload. To create the {stream-name} resource 1. Choose the /streams resource, and then choose Create resource. 2. Keep Proxy resource turned off. 3. 4. For Resource path, select /streams. For Resource name, enter {stream-name}. 5. Keep CORS (Cross Origin Resource Sharing) turned off. 6. Choose Create resource. Tutorial: Create a REST API as an Amazon Kinesis proxy 167 Amazon API Gateway Developer Guide To configure and test the GET method on a stream resource 1. Choose the /{stream-name} resource, and then choose Create method. 2. 3. 4. 5. For Method type, select GET. For Integration type, select AWS service. For AWS Region, select the AWS Region where you created your Kinesis stream. For AWS service, select Kinesis. 6. Keep AWS subdomain |
apigateway-dg-049 | apigateway-dg.pdf | 49 | off. 3. 4. For Resource path, select /streams. For Resource name, enter {stream-name}. 5. Keep CORS (Cross Origin Resource Sharing) turned off. 6. Choose Create resource. Tutorial: Create a REST API as an Amazon Kinesis proxy 167 Amazon API Gateway Developer Guide To configure and test the GET method on a stream resource 1. Choose the /{stream-name} resource, and then choose Create method. 2. 3. 4. 5. For Method type, select GET. For Integration type, select AWS service. For AWS Region, select the AWS Region where you created your Kinesis stream. For AWS service, select Kinesis. 6. Keep AWS subdomain blank. 7. 8. 9. For HTTP method, choose POST. For Action type, choose Use action name. For Action name, enter DescribeStream. 10. For Execution role, enter the ARN for your execution role. 11. Keep the default of Passthrough for Content Handling. 12. Choose Create method. 13. In the Integration request section, add the following URL request headers parameters: Content-Type: 'x-amz-json-1.1' The task follows the same procedure to set up the request parameter mapping for the GET / streams method. 14. Add the following body mapping template to map data from the GET /streams/{stream- name} method request to the POST /?Action=DescribeStream integration request: { "StreamName": "$input.params('stream-name')" } This mapping template generates the required integration request payload for the DescribeStream action of Kinesis from the method request's stream-name path parameter value. 15. To test the GET /stream/{stream-name} method to invoke the DescribeStream action in Kinesis, choose the Test tab. 16. For Path, under stream-name, enter the name of an existing Kinesis stream. Tutorial: Create a REST API as an Amazon Kinesis proxy 168 Amazon API Gateway Developer Guide 17. Choose Test. If the test is successful, a 200 OK response is returned with a payload similar to the following: { "StreamDescription": { "HasMoreShards": false, "RetentionPeriodHours": 24, "Shards": [ { "HashKeyRange": { "EndingHashKey": "68056473384187692692674921486353642290", "StartingHashKey": "0" }, "SequenceNumberRange": { "StartingSequenceNumber": "49559266461454070523309915164834022007924120923395850242" }, "ShardId": "shardId-000000000000" }, ... { "HashKeyRange": { "EndingHashKey": "340282366920938463463374607431768211455", "StartingHashKey": "272225893536750770770699685945414569164" }, "SequenceNumberRange": { "StartingSequenceNumber": "49559266461543273504104037657400164881014714369419771970" }, "ShardId": "shardId-000000000004" } ], "StreamARN": "arn:aws:kinesis:us-east-1:12345678901:stream/myStream", "StreamName": "myStream", "StreamStatus": "ACTIVE" } } After you deploy the API, you can make a REST request against this API method: Tutorial: Create a REST API as an Amazon Kinesis proxy 169 Amazon API Gateway Developer Guide GET https://your-api-id.execute-api.region.amazonaws.com/stage/streams/myStream HTTP/1.1 Host: your-api-id.execute-api.region.amazonaws.com Content-Type: application/json Authorization: ... X-Amz-Date: 20160323T194451Z To configure and test the POST method on a stream resource 1. Choose the /{stream-name} resource, and then choose Create method. 2. 3. 4. 5. For Method type, select POST. For Integration type, select AWS service. For AWS Region, select the AWS Region where you created your Kinesis stream. For AWS service, select Kinesis. 6. Keep AWS subdomain blank. 7. 8. 9. For HTTP method, choose POST. For Action type, choose Use action name. For Action name, enter CreateStream. 10. For Execution role, enter the ARN for your execution role. 11. Keep the default of Passthrough for Content Handling. 12. Choose Create method. 13. In the Integration request section, add the following URL request headers parameters: Content-Type: 'x-amz-json-1.1' The task follows the same procedure to set up the request parameter mapping for the GET / streams method. 14. Add the following body mapping template to map data from the POST /streams/{stream- name} method request to the POST /?Action=CreateStream integration request: { "ShardCount": #if($input.path('$.ShardCount') == '') 5 #else $input.path('$.ShardCount') #end, Tutorial: Create a REST API as an Amazon Kinesis proxy 170 Amazon API Gateway Developer Guide "StreamName": "$input.params('stream-name')" } In the preceding mapping template, we set ShardCount to a fixed value of 5 if the client does not specify a value in the method request payload. 15. To test the POST /stream/{stream-name} method to invoke the CreateStream action in Kinesis, choose the Test tab. 16. For Path, under stream-name, enter the name of a new Kinesis stream. 17. Choose Test. If the test is successful, a 200 OK response is returned with no data. After you deploy the API, you can also make a REST API request against the POST method on a Stream resource to invoke the CreateStream action in Kinesis: POST https://your-api-id.execute-api.region.amazonaws.com/stage/streams/yourStream HTTP/1.1 Host: your-api-id.execute-api.region.amazonaws.com Content-Type: application/json Authorization: ... X-Amz-Date: 20160323T194451Z { "ShardCount": 5 } Configure and test the DELETE method on a stream resource 1. Choose the /{stream-name} resource, and then choose Create method. 2. 3. 4. 5. For Method type, select DELETE. For Integration type, select AWS service. For AWS Region, select the AWS Region where you created your Kinesis stream. For AWS service, select Kinesis. 6. Keep AWS subdomain blank. 7. 8. For HTTP method, choose POST. For Action type, choose Use action name. Tutorial: Create a REST API as an Amazon Kinesis proxy 171 Amazon API Gateway Developer Guide 9. For Action name, enter DeleteStream. 10. For Execution role, enter the ARN for your execution |
apigateway-dg-050 | apigateway-dg.pdf | 50 | DELETE method on a stream resource 1. Choose the /{stream-name} resource, and then choose Create method. 2. 3. 4. 5. For Method type, select DELETE. For Integration type, select AWS service. For AWS Region, select the AWS Region where you created your Kinesis stream. For AWS service, select Kinesis. 6. Keep AWS subdomain blank. 7. 8. For HTTP method, choose POST. For Action type, choose Use action name. Tutorial: Create a REST API as an Amazon Kinesis proxy 171 Amazon API Gateway Developer Guide 9. For Action name, enter DeleteStream. 10. For Execution role, enter the ARN for your execution role. 11. Keep the default of Passthrough for Content Handling. 12. Choose Create method. 13. In the Integration request section, add the following URL request headers parameters: Content-Type: 'x-amz-json-1.1' The task follows the same procedure to set up the request parameter mapping for the GET / streams method. 14. Add the following body mapping template to map data from the DELETE /streams/ {stream-name} method request to the corresponding integration request of POST /? Action=DeleteStream : { "StreamName": "$input.params('stream-name')" } This mapping template generates the required input for the DELETE /streams/{stream- name} action from the client-supplied URL path name of stream-name. 15. To test the DELETE /stream/{stream-name} method to invoke the DeleteStream action in Kinesis, choose the Test tab. 16. For Path, under stream-name, enter the name of an existing Kinesis stream. 17. Choose Test. If the test is successful, a 200 OK response is returned with no data. After you deploy the API, you can also make the following REST API request against the DELETE method on the Stream resource to call the DeleteStream action in Kinesis: DELETE https://your-api-id.execute-api.region.amazonaws.com/stage/ streams/yourStream HTTP/1.1 Host: your-api-id.execute-api.region.amazonaws.com Content-Type: application/json Authorization: ... X-Amz-Date: 20160323T194451Z {} Tutorial: Create a REST API as an Amazon Kinesis proxy 172 Amazon API Gateway Developer Guide Get records from and add records to a stream in Kinesis After you create a stream in Kinesis, you can add data records to the stream and read the data from the stream. Adding data records involves calling the PutRecords or PutRecord action in Kinesis. The former adds multiple records whereas the latter adds a single record to the stream. POST /?Action=PutRecords HTTP/1.1 Host: kinesis.region.domain Authorization: AWS4-HMAC-SHA256 Credential=..., ... ... Content-Type: application/x-amz-json-1.1 Content-Length: PayloadSizeBytes { "Records": [ { "Data": blob, "ExplicitHashKey": "string", "PartitionKey": "string" } ], "StreamName": "string" } or POST /?Action=PutRecord HTTP/1.1 Host: kinesis.region.domain Authorization: AWS4-HMAC-SHA256 Credential=..., ... ... Content-Type: application/x-amz-json-1.1 Content-Length: PayloadSizeBytes { "Data": blob, "ExplicitHashKey": "string", Tutorial: Create a REST API as an Amazon Kinesis proxy 173 Amazon API Gateway Developer Guide "PartitionKey": "string", "SequenceNumberForOrdering": "string", "StreamName": "string" } Here, StreamName identifies the target stream to add records. StreamName, Data, and PartitionKey are required input data. In our example, we use the default values for all of the optional input data and will not explicitly specify values for them in the input to the method request. Reading data in Kinesis amounts to calling the GetRecords action: POST /?Action=GetRecords HTTP/1.1 Host: kinesis.region.domain Authorization: AWS4-HMAC-SHA256 Credential=..., ... ... Content-Type: application/x-amz-json-1.1 Content-Length: PayloadSizeBytes { "ShardIterator": "string", "Limit": number } Here, the source stream from which we are getting records is specified in the required ShardIterator value, as is shown in the following Kinesis action to obtain a shard iterator: POST /?Action=GetShardIterator HTTP/1.1 Host: kinesis.region.domain Authorization: AWS4-HMAC-SHA256 Credential=..., ... ... Content-Type: application/x-amz-json-1.1 Content-Length: PayloadSizeBytes { "ShardId": "string", "ShardIteratorType": "string", "StartingSequenceNumber": "string", "StreamName": "string" } Tutorial: Create a REST API as an Amazon Kinesis proxy 174 Amazon API Gateway Developer Guide For the GetRecords and PutRecords actions, we expose the GET and PUT methods, respectively, on a /records resource that is appended to a named stream resource (/{stream-name}). Similarly, we expose the PutRecord action as a PUT method on a /record resource. Because the GetRecords action takes as input a ShardIterator value, which is obtained by calling the GetShardIterator helper action, we expose a GET helper method on a ShardIterator resource (/sharditerator). To create the /record, /records, and /sharditerator resources 1. Choose the /{stream-name} resource, and then choose Create resource. 2. Keep Proxy resource turned off. 3. 4. For Resource path, select /{stream-name}. For Resource name, enter record. 5. Keep CORS (Cross Origin Resource Sharing) turned off. 6. Choose Create resource. 7. Repeat the previous steps to create a /records and a /sharditerator resource. The final API should look like the following: Tutorial: Create a REST API as an Amazon Kinesis proxy 175 Amazon API Gateway Developer Guide The following four procedures describe how to set up each of the methods, how to map data from the method requests to the integration requests, and how to test the methods. Tutorial: Create a REST API as an Amazon Kinesis proxy 176 Amazon API Gateway Developer Guide To set up and test the PUT /streams/{stream-name}/record method to invoke |
apigateway-dg-051 | apigateway-dg.pdf | 51 | off. 6. Choose Create resource. 7. Repeat the previous steps to create a /records and a /sharditerator resource. The final API should look like the following: Tutorial: Create a REST API as an Amazon Kinesis proxy 175 Amazon API Gateway Developer Guide The following four procedures describe how to set up each of the methods, how to map data from the method requests to the integration requests, and how to test the methods. Tutorial: Create a REST API as an Amazon Kinesis proxy 176 Amazon API Gateway Developer Guide To set up and test the PUT /streams/{stream-name}/record method to invoke PutRecord in Kinesis: 1. Choose the /record, and then choose Create method. 2. 3. 4. 5. For Method type, select PUT. For Integration type, select AWS service. For AWS Region, select the AWS Region where you created your Kinesis stream. For AWS service, select Kinesis. 6. Keep AWS subdomain blank. 7. 8. 9. For HTTP method, choose POST. For Action type, choose Use action name. For Action name, enter PutRecord. 10. For Execution role, enter the ARN for your execution role. 11. Keep the default of Passthrough for Content Handling. 12. Choose Create method. 13. In the Integration request section, add the following URL request headers parameters: Content-Type: 'x-amz-json-1.1' The task follows the same procedure to set up the request parameter mapping for the GET / streams method. 14. Add the following body mapping template to map data from the PUT /streams/{stream- name}/record method request to the corresponding integration request of POST /? Action=PutRecord: { "StreamName": "$input.params('stream-name')", "Data": "$util.base64Encode($input.json('$.Data'))", "PartitionKey": "$input.path('$.PartitionKey')" } This mapping template assumes that the method request payload is of the following format: { Tutorial: Create a REST API as an Amazon Kinesis proxy 177 Amazon API Gateway Developer Guide "Data": "some data", "PartitionKey": "some key" } This data can be modeled by the following JSON schema: { "$schema": "http://json-schema.org/draft-04/schema#", "title": "PutRecord proxy single-record payload", "type": "object", "properties": { "Data": { "type": "string" }, "PartitionKey": { "type": "string" } } } You can create a model to include this schema and use the model to facilitate generating the mapping template. However, you can generate a mapping template without using any model. 15. To test the PUT /streams/{stream-name}/record method, set the stream-name path variable to the name of an existing stream, supply a payload of the required format, and then submit the method request. The successful result is a 200 OK response with a payload of the following format: { "SequenceNumber": "49559409944537880850133345460169886593573102115167928386", "ShardId": "shardId-000000000004" } To set up and test the PUT /streams/{stream-name}/records method to invoke PutRecords in Kinesis 1. Choose the /records resource, and then choose Create method. 2. 3. 4. 5. For Method type, select PUT. For Integration type, select AWS service. For AWS Region, select the AWS Region where you created your Kinesis stream. For AWS service, select Kinesis. Tutorial: Create a REST API as an Amazon Kinesis proxy 178 Amazon API Gateway Developer Guide 6. Keep AWS subdomain blank. 7. 8. 9. For HTTP method, choose POST. For Action type, choose Use action name. For Action name, enter PutRecords. 10. For Execution role, enter the ARN for your execution role. 11. Keep the default of Passthrough for Content Handling. 12. Choose Create method. 13. In the Integration request section, add the following URL request headers parameters: Content-Type: 'x-amz-json-1.1' The task follows the same procedure to set up the request parameter mapping for the GET / streams method. 14. Add the following mapping template to map data from the PUT /streams/{stream- name}/records method request to the corresponding integration request of POST /? Action=PutRecords : { "StreamName": "$input.params('stream-name')", "Records": [ #foreach($elem in $input.path('$.records')) { "Data": "$util.base64Encode($elem.data)", "PartitionKey": "$elem.partition-key" }#if($foreach.hasNext),#end #end ] } This mapping template assumes that the method request payload can be modelled by the following JSON schema: { "$schema": "http://json-schema.org/draft-04/schema#", "title": "PutRecords proxy payload data", "type": "object", "properties": { "records": { Tutorial: Create a REST API as an Amazon Kinesis proxy 179 Amazon API Gateway Developer Guide "type": "array", "items": { "type": "object", "properties": { "data": { "type": "string" }, "partition-key": { "type": "string" } } } } } } You can create a model to include this schema and use the model to facilitate generating the mapping template. However, you can generate a mapping template without using any model. In this tutorial, we used two slightly different payload formats to illustrate that an API developer can choose to expose the backend data format to the client or hide it from the client. One format is for the PUT /streams/{stream-name}/records method (above). Another format is used for the PUT /streams/{stream-name}/record method (in the previous procedure). In production environment, you should keep both formats consistent. 15. To test the PUT /streams/{stream-name}/records method, set the stream-name path variable to an existing stream, supply the following payload, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.