Skip to content

create_project

create_project(
    name: Name,
    *,
    config_overrides: Optional[DeviceFarmClientConfig] = None,
    default_job_timeout_minutes: Optional[JobTimeoutMinutes] = None,
    vpc_config: Optional[VpcConfig] = None,
    environment_variables: Optional[EnvironmentVariables] = None,
    execution_role_arn: Optional[AmazonRoleResourceName] = None,
) -> CreateProjectResult

Creates a project.

Parameters:

  • name (Name) –

    The project's name.

  • default_job_timeout_minutes (Optional[JobTimeoutMinutes], default: None ) –

    Sets the execution timeout value (in minutes) for a project. All test runs in this project use the specified execution timeout value unless overridden when scheduling a run.

  • vpc_config (Optional[VpcConfig], default: None ) –

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

  • environment_variables (Optional[EnvironmentVariables], default: None ) –

    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.

  • execution_role_arn (Optional[AmazonRoleResourceName], default: None ) –

    An IAM role to be assumed by the test host for all runs in the project.

Raises:

Source code in docs_src/capo_device_farm/_services/device_farm.py
def create_project(
    self,
    name: "capo_device_farm.types.name.Name",
    *,
    config_overrides: Optional[DeviceFarmClientConfig] = None,
    default_job_timeout_minutes: Optional[
        "capo_device_farm.types.job_timeout_minutes.JobTimeoutMinutes"
    ] = None,
    vpc_config: Optional["capo_device_farm.types.vpc_config.VpcConfig"] = None,
    environment_variables: Optional[
        "capo_device_farm.types.environment_variables.EnvironmentVariables"
    ] = None,
    execution_role_arn: Optional[
        "capo_device_farm.types.amazon_role_resource_name.AmazonRoleResourceName"
    ] = None,
) -> "capo_device_farm.types.create_project_result.CreateProjectResult":
    """<p>Creates a project.</p>

    Args:
        name: <p>The project's name.</p>
        default_job_timeout_minutes: <p>Sets the execution timeout value (in minutes) for a project. All test runs in this project use the specified execution timeout value unless overridden when scheduling a run.</p>
        vpc_config: <p>The VPC security groups and subnets that are attached to a project.</p>
        environment_variables: <p> 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. </p> <p> For more information about using test spec files, please see <a href="https://docs.aws.amazon.com/devicefarm/latest/developerguide/custom-test-environments.html">Custom test environments </a> in <i>AWS Device Farm.</i> </p>
        execution_role_arn: <p>An IAM role to be assumed by the test host for all runs in the project.</p>

    Raises:
        capo_device_farm.errors.argument_exception.ArgumentException: <p>An invalid argument was specified.</p>
        capo_device_farm.errors.limit_exceeded_exception.LimitExceededException: <p>A limit was exceeded.</p>
        capo_device_farm.errors.not_found_exception.NotFoundException: <p>The specified entity was not found.</p>
        capo_device_farm.errors.service_account_exception.ServiceAccountException: <p>There was a problem with the service account.</p>
        capo_device_farm.errors.tag_operation_exception.TagOperationException: <p>The operation was not successful. Try again.</p>
        capo_device_farm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_device_farm.types.create_project_request.CreateProjectRequest]",
    ) -> OperationResponse[
        "capo_device_farm.types.create_project_result.CreateProjectResult"
    ]:
        import capo_device_farm._operations.device_farm_20150623.create_project

        output, http_response = (
            capo_device_farm._operations.device_farm_20150623.create_project.create_project(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateProject")
    )
    input_: capo_device_farm.types.create_project_request.CreateProjectRequest = {
        "name": name
    }
    if default_job_timeout_minutes is not None:
        input_["default_job_timeout_minutes"] = default_job_timeout_minutes
    if vpc_config is not None:
        input_["vpc_config"] = vpc_config
    if environment_variables is not None:
        input_["environment_variables"] = environment_variables
    if execution_role_arn is not None:
        input_["execution_role_arn"] = execution_role_arn

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output