Skip to content

register_service async

register_service(
    service: PostRegisterServiceSupportedService,
    service_details: ServiceDetails,
    *,
    config_overrides: Optional[AsyncDevOpsAgentClientConfig] = None,
    kms_key_arn: Optional[KmsKeyArn] = None,
    private_connection_name: Optional[PrivateConnectionName] = None,
    target_url_private_connection_name: Optional[PrivateConnectionName] = None,
    exchange_url_private_connection_name: Optional[PrivateConnectionName] = None,
    name: Optional[ServiceNameInput] = None,
    tags: Optional[Tags] = None,
) -> RegisterServiceOutput

This operation registers the specified service

Parameters:

  • service_details (ServiceDetails) –

    Service-specific authorization configuration parameters

  • kms_key_arn (Optional[KmsKeyArn], default: None ) –

    The ARN of the AWS Key Management Service (AWS KMS) customer managed key that's used to encrypt resources.

  • private_connection_name (Optional[PrivateConnectionName], default: None ) –

    The name of the private connection to use for VPC connectivity.

  • target_url_private_connection_name (Optional[PrivateConnectionName], default: None ) –

    The name of the private connection to use for API calls (target URL) only. Cannot be specified when privateConnectionName is provided.

  • exchange_url_private_connection_name (Optional[PrivateConnectionName], default: None ) –

    The name of the private connection to use for OAuth token exchange requests only. Cannot be specified when privateConnectionName is provided.

  • name (Optional[ServiceNameInput], default: None ) –

    The display name for the service registration.

  • tags (Optional[Tags], default: None ) –

    Tags to add to the Service at registration time.

Raises:

Source code in docs_src/capo_devops_agent/_services/async_dev_ops_agent.py
async def register_service(
    self,
    service: "capo_devops_agent.types.post_register_service_supported_service.PostRegisterServiceSupportedService",
    service_details: "capo_devops_agent.types.service_details.ServiceDetails",
    *,
    config_overrides: Optional[AsyncDevOpsAgentClientConfig] = None,
    kms_key_arn: Optional["capo_devops_agent.types.kms_key_arn.KmsKeyArn"] = None,
    private_connection_name: Optional[
        "capo_devops_agent.types.private_connection_name.PrivateConnectionName"
    ] = None,
    target_url_private_connection_name: Optional[
        "capo_devops_agent.types.private_connection_name.PrivateConnectionName"
    ] = None,
    exchange_url_private_connection_name: Optional[
        "capo_devops_agent.types.private_connection_name.PrivateConnectionName"
    ] = None,
    name: Optional[
        "capo_devops_agent.types.service_name_input.ServiceNameInput"
    ] = None,
    tags: Optional["capo_devops_agent.types.tags.Tags"] = None,
) -> "capo_devops_agent.types.register_service_output.RegisterServiceOutput":
    """<p>This operation registers the specified service</p>

    Args:
        service_details: <p>Service-specific authorization configuration parameters</p>
        kms_key_arn: <p>The ARN of the AWS Key Management Service (AWS KMS) customer managed key that's used to encrypt resources.</p>
        private_connection_name: <p>The name of the private connection to use for VPC connectivity.</p>
        target_url_private_connection_name: <p>The name of the private connection to use for API calls (target URL) only. Cannot be specified when privateConnectionName is provided.</p>
        exchange_url_private_connection_name: <p>The name of the private connection to use for OAuth token exchange requests only. Cannot be specified when privateConnectionName is provided.</p>
        name: <p>The display name for the service registration.</p>
        tags: <p>Tags to add to the Service at registration time.</p>

    Raises:
        capo_devops_agent.errors.access_denied_exception.AccessDeniedException: <p>Access to the requested resource is denied due to insufficient permissions.</p>
        capo_devops_agent.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource.</p>
        capo_devops_agent.errors.content_size_exceeded_exception.ContentSizeExceededException: <p>This exception is thrown when the content size exceeds the allowed limit.</p>
        capo_devops_agent.errors.internal_server_exception.InternalServerException: <p>This exception is thrown when an unexpected error occurs in the processing of a request.</p>
        capo_devops_agent.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more parameters provided in the request are invalid.</p>
        capo_devops_agent.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource could not be found.</p>
        capo_devops_agent.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would exceed the service quota limit.</p>
        capo_devops_agent.errors.throttling_exception.ThrottlingException: <p>The request was throttled due to too many requests. Please slow down and try again.</p>
        capo_devops_agent.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service.</p>
        capo_devops_agent.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_devops_agent.types.register_service_input.RegisterServiceInput]",
    ) -> AsyncOperationResponse[
        "capo_devops_agent.types.register_service_output.RegisterServiceOutput"
    ]:
        import capo_devops_agent._operations.dev_ops_agent.register_service

        (
            output,
            http_response,
        ) = await capo_devops_agent._operations.dev_ops_agent.register_service.async_register_service(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_devops_agent.types.register_service_input.RegisterServiceInput",
    ) -> dict[str, Any]:
        import capo_devops_agent.types.register_service_input

        return capo_devops_agent.types.register_service_input.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("RegisterService", redact_input=_redact_input),
    )
    input_: capo_devops_agent.types.register_service_input.RegisterServiceInput = {
        "service": service,
        "service_details": service_details,
    }
    if kms_key_arn is not None:
        input_["kms_key_arn"] = kms_key_arn
    if private_connection_name is not None:
        input_["private_connection_name"] = private_connection_name
    if target_url_private_connection_name is not None:
        input_["target_url_private_connection_name"] = (
            target_url_private_connection_name
        )
    if exchange_url_private_connection_name is not None:
        input_["exchange_url_private_connection_name"] = (
            exchange_url_private_connection_name
        )
    if name is not None:
        input_["name"] = name
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output