Cloud9 / Client / describe_environment_memberships

describe_environment_memberships#

Cloud9.Client.describe_environment_memberships(**kwargs)#

Gets information about environment members for an Cloud9 development environment.

Warning

Cloud9 is no longer available to new customers. Existing customers of Cloud9 can continue to use the service as normal. Learn more”

See also: AWS API Documentation

Request Syntax

response = client.describe_environment_memberships(
    userArn='string',
    environmentId='string',
    permissions=[
        'owner'|'read-write'|'read-only',
    ],
    nextToken='string',
    maxResults=123
)
Parameters:
  • userArn (string) – 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.

  • environmentId (string) – The ID of the environment to get environment member information about.

  • permissions (list) –

    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.

    • (string) –

  • nextToken (string) – 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.

  • maxResults (integer) – The maximum number of environment members to get information about.

Return type:

dict

Returns:

Response Syntax

{
    'memberships': [
        {
            'permissions': 'owner'|'read-write'|'read-only',
            'userId': 'string',
            'userArn': 'string',
            'environmentId': 'string',
            'lastAccess': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • memberships (list) –

      Information about the environment members for the environment.

      • (dict) –

        Information about an environment member for an Cloud9 development environment.

        • permissions (string) –

          The type of environment member permissions associated with this environment member. 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.

        • userId (string) –

          The user ID in Identity and Access Management (IAM) of the environment member.

        • userArn (string) –

          The Amazon Resource Name (ARN) of the environment member.

        • environmentId (string) –

          The ID of the environment for the environment member.

        • lastAccess (datetime) –

          The time, expressed in epoch time format, when the environment member last opened the environment.

    • nextToken (string) –

      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.

Exceptions

Examples

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

response = client.describe_environment_memberships(
    environmentId='8d9967e2f0624182b74e7690ad69ebEX',
)

print(response)

Expected Output:

{
    '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',
        },
    ],
    'ResponseMetadata': {
        '...': '...',
    },
}

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

response = client.describe_environment_memberships(
    environmentId='8d9967e2f0624182b74e7690ad69ebEX',
    permissions=[
        'owner',
    ],
)

print(response)

Expected Output:

{
    'memberships': [
        {
            'environmentId': '8d9967e2f0624182b74e7690ad69ebEX',
            'permissions': 'owner',
            'userArn': 'arn:aws:iam::123456789012:user/MyDemoUser',
            'userId': 'AIDAJNUEDQAQWFELJDLEX',
        },
    ],
    'ResponseMetadata': {
        '...': '...',
    },
}

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

response = client.describe_environment_memberships(
    userArn='arn:aws:iam::123456789012:user/MyDemoUser',
)

print(response)

Expected Output:

{
    'memberships': [
        {
            'environmentId': '10a75714bd494714929e7f5ec4125aEX',
            'lastAccess': datetime(2018, 1, 19, 11, 6, 13, 4, 19, 0),
            'permissions': 'owner',
            'userArn': 'arn:aws:iam::123456789012:user/MyDemoUser',
            'userId': 'AIDAJNUEDQAQWFELJDLEX',
        },
        {
            'environmentId': '12bfc3cd537f41cb9776f8af5525c9EX',
            'lastAccess': datetime(2018, 1, 19, 11, 39, 19, 4, 19, 0),
            'permissions': 'owner',
            'userArn': 'arn:aws:iam::123456789012:user/MyDemoUser',
            'userId': 'AIDAJNUEDQAQWFELJDLEX',
        },
    ],
    'ResponseMetadata': {
        '...': '...',
    },
}