DeviceFarm / Client / update_project

update_project

DeviceFarm.Client.update_project(**kwargs)

Modifies the specified project name, given the project ARN and a new name.

See also: AWS API Documentation

Request Syntax

response = client.update_project(
    arn='string',
    name='string',
    defaultJobTimeoutMinutes=123,
    vpcConfig={
        'securityGroupIds': [
            'string',
        ],
        'subnetIds': [
            'string',
        ],
        'vpcId': 'string'
    },
    environmentVariables=[
        {
            'name': 'string',
            'value': 'string'
        },
    ],
    executionRoleArn='string'
)
Parameters:
  • arn (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the project whose name to update.

  • name (string) – A string that represents the new name of the project that you are updating.

  • defaultJobTimeoutMinutes (integer) – The number of minutes a test run in the project executes before it times out.

  • vpcConfig (dict) –

    The VPC security groups and subnets that are attached to a project.

    • securityGroupIds (list) – [REQUIRED]

      An array of one or more security groups IDs in your Amazon VPC.

      • (string) –

    • subnetIds (list) – [REQUIRED]

      An array of one or more subnet IDs in your Amazon VPC.

      • (string) –

    • vpcId (string) – [REQUIRED]

      The ID of the Amazon VPC.

  • environmentVariables (list) –

    A set of environment variables which are used by default for all runs in the project. These environment variables are applied to the test run during the execution of a test spec file.

    For more information about using test spec files, please see Custom test environments in AWS Device Farm.

    • (dict) –

      Information about an environment variable for a project or a run.

      • name (string) – [REQUIRED]

        The name of the environment variable.

      • value (string) – [REQUIRED]

        The value of the environment variable.

  • executionRoleArn (string) – An IAM role to be assumed by the test host for all runs in the project.

Return type:

dict

Returns:

Response Syntax

{
    'project': {
        'arn': 'string',
        'name': 'string',
        'defaultJobTimeoutMinutes': 123,
        'created': datetime(2015, 1, 1),
        'vpcConfig': {
            'securityGroupIds': [
                'string',
            ],
            'subnetIds': [
                'string',
            ],
            'vpcId': 'string'
        },
        'environmentVariables': [
            {
                'name': 'string',
                'value': 'string'
            },
        ],
        'executionRoleArn': 'string'
    }
}

Response Structure

  • (dict) –

    Represents the result of an update project request.

    • project (dict) –

      The project to update.

      • arn (string) –

        The project’s ARN.

      • name (string) –

        The project’s name.

      • defaultJobTimeoutMinutes (integer) –

        The default number of minutes (at the project level) a test run executes before it times out. The default value is 150 minutes.

      • created (datetime) –

        When the project was created.

      • vpcConfig (dict) –

        The VPC security groups and subnets that are attached to a project.

        • securityGroupIds (list) –

          An array of one or more security groups IDs in your Amazon VPC.

          • (string) –

        • subnetIds (list) –

          An array of one or more subnet IDs in your Amazon VPC.

          • (string) –

        • vpcId (string) –

          The ID of the Amazon VPC.

      • environmentVariables (list) –

        Environment variables associated with the project.

        • (dict) –

          Information about an environment variable for a project or a run.

          • name (string) –

            The name of the environment variable.

          • value (string) –

            The value of the environment variable.

      • executionRoleArn (string) –

        The IAM execution role associated with the project.

Exceptions

  • DeviceFarm.Client.exceptions.ArgumentException

  • DeviceFarm.Client.exceptions.NotFoundException

  • DeviceFarm.Client.exceptions.LimitExceededException

  • DeviceFarm.Client.exceptions.ServiceAccountException

Examples

The following example updates the specified project with a new name.

response = client.update_project(
    name='NewName',
    # You can get the Amazon Resource Name (ARN) of the project by using the list-projects CLI command.
    arn='arn:aws:devicefarm:us-west-2:123456789101:project:8f75187d-101e-4625-accc-12345EXAMPLE',
)

print(response)

Expected Output:

{
    'project': {
        'name': 'NewName',
        'arn': 'arn:aws:devicefarm:us-west-2:123456789101:project:8f75187d-101e-4625-accc-12345EXAMPLE',
        'created': datetime(2015, 11, 24, 21, 31, 49, 1, 328, 0),
    },
    'ResponseMetadata': {
        '...': '...',
    },
}