AWS Cloud9
API Reference (API Version 2017-09-23)

DescribeEnvironmentMemberships

Gets information about environment members for an AWS Cloud9 development environment.

Request Syntax

{ "environmentId": "string", "maxResults": number, "nextToken": "string", "permissions": [ "string" ], "userArn": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

environmentId

The ID of the environment to get environment member information about.

Type: String

Pattern: ^[a-zA-Z0-9]{8,32}$

Required: No

maxResults

The maximum number of environment members to get information about.

Type: Integer

Valid Range: Minimum value of 0. Maximum value of 25.

Required: No

nextToken

During a previous call, if there are more than 25 items in the list, only the first 25 items are returned, along with a unique string called a next token. To get the next batch of items in the list, call this operation again, adding the next token to the call. To get all of the items in the list, keep calling this operation with each subsequent next token that is returned, until no more next tokens are returned.

Type: String

Required: No

permissions

The type of environment member permissions to get information about. Available values include:

  • owner: Owns the environment.

  • read-only: Has read-only access to the environment.

  • read-write: Has read-write access to the environment.

If no value is specified, information about all environment members are returned.

Type: Array of strings

Valid Values: owner | read-write | read-only

Required: No

userArn

The Amazon Resource Name (ARN) of an individual environment member to get information about. If no value is specified, information about all environment members are returned.

Type: String

Pattern: arn:aws:(iam|sts)::\d+:(root|user|federated-user|assumed-role)\/?\S*

Required: No

Response Syntax

{ "memberships": [ { "environmentId": "string", "lastAccess": number, "permissions": "string", "userArn": "string", "userId": "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.

memberships

Information about the environment members for the environment.

Type: Array of EnvironmentMember objects

nextToken

If there are more than 25 items in the list, only the first 25 items are returned, along with a unique string called a next token. To get the next batch of items in the list, call this operation again, adding the next token to the call.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors.

BadRequestException

The target request is invalid.

HTTP Status Code: 400

ConflictException

A conflict occurred.

HTTP Status Code: 400

ForbiddenException

An access permissions issue occurred.

HTTP Status Code: 400

InternalServerErrorException

An internal server error occurred.

HTTP Status Code: 500

LimitExceededException

A service limit was exceeded.

HTTP Status Code: 400

NotFoundException

The target resource cannot be found.

HTTP Status Code: 400

TooManyRequestsException

Too many service requests were made over the given time period.

HTTP Status Code: 400

Examples

Get Environment Members for an AWS Cloud9 Development Environment

The following example gets information about all of the environment members for the specified AWS Cloud9 development environment.

Sample Request

POST / HTTP/1.1 Host: cloud9.us-east-2.amazonaws.com Accept-Encoding: identity X-Amz-Target: AWSCloud9WorkspaceManagementService.DescribeEnvironmentMemberships Content-Type: application/x-amz-json-1.1 X-Amz-Date: 20180123T231253Z User-Agent: aws-cli/1.14.29 Python/3.5.2 Windows/10 botocore/1.8.33 Authorization: AWS4-HMAC-SHA256 Credential=AKIAJ32OEXAMPLE/20180123/us-east-2/cloud9/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=50dbf72dEXAMPLE Content-Length: 53 { "environmentId": "8d9967e2f0624182b74e7690ad69ebEX" }

Sample Response

HTTP/1.1 200 OK Date: Tue, 23 Jan 2018 23:12:55 GMT Content-Type: application/x-amz-json-1.1 Content-Length: 350 x-amzn-RequestId: f1680001-0092-11e8-a65b-093e8a557dEX Connection: Keep-alive { "memberships": [ { "environmentId": "8d9967e2f0624182b74e7690ad69ebEX", "permissions": "read-write", "userArn": "arn:aws:iam::123456789012:user/AnotherDemoUser", "userId": "AIDAJ3BA6O2FMJWCWXHEX" }, { "environmentId": "8d9967e2f0624182b74e7690ad69ebEX", "permissions": "owner", "userArn": "arn:aws:iam::123456789012:user/MyDemoUser", "userId": "AIDAJNUEDQAQWFELJDLEX" } ] }

Get the Owner of an AWS Cloud9 Development Environment

The following example gets information about the owner of the specified AWS Cloud9 development environment.

Sample Request

POST / HTTP/1.1 Host: cloud9.us-east-2.amazonaws.com Accept-Encoding: identity Content-Type: application/x-amz-json-1.1 User-Agent: aws-cli/1.14.29 Python/3.5.2 Windows/10 botocore/1.8.33 X-Amz-Date: 20180123T231350Z X-Amz-Target: AWSCloud9WorkspaceManagementService.DescribeEnvironmentMemberships Authorization: AWS4-HMAC-SHA256 Credential=AKIAJ32OEXAMPLE/20180123/us-east-2/cloud9/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=94ccc4d0EXAMPLE Content-Length: 79 { "permissions": [ "owner" ], "environmentId": "8d9967e2f0624182b74e7690ad69ebEX" }

Sample Response

HTTP/1.1 200 OK Date: Tue, 23 Jan 2018 23:13:51 GMT Content-Type: application/x-amz-json-1.1 Content-Length: ... x-amzn-RequestId: 13328344-0093-11e8-9118-55255722b4EX Connection: Keep-alive { "memberships": [ { "environmentId": "8d9967e2f0624182b74e7690ad69ebEX", "permissions": "owner", "userArn": "arn:aws:iam::123456789012:user/MyDemoUser", "userId": "AIDAJNUEDQAQWFELJDLEX" } ] }

Get AWS Cloud9 Development Environment Memberships for a User

The following example gets AWS Cloud9 development environment membership information for the specified user.

Sample Request

POST / HTTP/1.1 Host: cloud9.us-east-2.amazonaws.com Accept-Encoding: identity Content-Type: application/x-amz-json-1.1 X-Amz-Target: AWSCloud9WorkspaceManagementService.DescribeEnvironmentMemberships X-Amz-Date: 20180123T231447Z Authorization: AWS4-HMAC-SHA256 Credential=AKIAJ32OEXAMPLE/20180123/us-east-2/cloud9/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=112ae541EXAMPLE Content-Length: 55 User-Agent: aws-cli/1.14.29 Python/3.5.2 Windows/10 botocore/1.8.33 { "userArn": "arn:aws:iam::123456789012:user/MyDemoUser" }

Sample Response

HTTP/1.1 200 OK Date: Tue, 23 Jan 2018 23:14:48 GMT Content-Type: application/x-amz-json-1.1 Content-Length: 1118 x-amzn-RequestId: 34d50be5-0093-11e8-a7e1-d3b8935decEX Connection: Keep-alive { "memberships": [ { "environmentId": "10a75714bd494714929e7f5ec4125aEX", "lastAccess": 1.516403173E9, "permissions": "owner", "userArn": "arn:aws:iam::123456789012:user/MyDemoUser", "userId": "AIDAJNUEDQAQWFELJDLEX" }, { "environmentId": "12bfc3cd537f41cb9776f8af5525c9EX", "lastAccess": 1.516405159E9, "permissions": "owner", "userArn": "arn:aws:iam::123456789012:user/MyDemoUser", "userId": "AIDAJNUEDQAQWFELJDLEX" } ] }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: