Skip to content

update_profile

update_profile(
    identifier: Identifier,
    *,
    config_overrides: Optional[CloudExtensionsClientConfig] = None,
    name: Optional[Name] = None,
    description: Optional[ClearableDescription_256] = None,
    extension_defaults: Optional[ExtensionDefaults] = None,
) -> UpdateProfileOutput

Updates a profile's mutable properties. Only provided fields are changed; omitted fields remain unchanged.

Parameters:

  • identifier (Identifier) –

    The identifier (id or name) of the profile to update.

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

    The new name of the profile. Must be unique within the account.

  • description (Optional[ClearableDescription_256], default: None ) –

    A human-readable description of the profile's purpose or target environment. An empty string removes the description.

  • extension_defaults (Optional[ExtensionDefaults], default: None ) –

    Default values used by the extensions in this profile. These can be overridden at the profile entry level.

Raises:

  • AccessDeniedException –

    The caller does not have permission to perform the operation.

  • InternalServerException –

    The service couldn't process the request because of an internal error. Retry with capped exponential backoff and jitter.

  • ThrottlingException –

    The request rate exceeded a limit. Retry with capped exponential backoff and jitter.

  • ConflictException –

    The request conflicts with the current state of the resource.

  • ResourceNotFoundException –

    The specified resource does not exist or the caller does not have permission to access it.

  • ValidationException –

    The request was malformed or contained invalid parameter values.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_cloudextensions/_services/cloud_extensions.py
def update_profile(
    self,
    identifier: "capo_cloudextensions.types.identifier.Identifier",
    *,
    config_overrides: Optional[CloudExtensionsClientConfig] = None,
    name: Optional["capo_cloudextensions.types.name.Name"] = None,
    description: Optional[
        "capo_cloudextensions.types.clearable_description_256.ClearableDescription_256"
    ] = None,
    extension_defaults: Optional[
        "capo_cloudextensions.types.extension_defaults.ExtensionDefaults"
    ] = None,
) -> "capo_cloudextensions.types.update_profile_output.UpdateProfileOutput":
    """Updates a profile's mutable properties. Only provided fields are changed; omitted fields remain unchanged.

    Args:
        identifier: The identifier (id or name) of the profile to update.
        name: The new name of the profile. Must be unique within the account.
        description: A human-readable description of the profile's purpose or target environment. An empty string removes the description.
        extension_defaults: Default values used by the extensions in this profile. These can be overridden at the profile entry level.

    Raises:
        capo_cloudextensions.errors.access_denied_exception.AccessDeniedException: The caller does not have permission to perform the operation.
        capo_cloudextensions.errors.internal_server_exception.InternalServerException: The service couldn't process the request because of an internal error. Retry with capped exponential backoff and jitter.
        capo_cloudextensions.errors.throttling_exception.ThrottlingException: The request rate exceeded a limit. Retry with capped exponential backoff and jitter.
        capo_cloudextensions.errors.conflict_exception.ConflictException: The request conflicts with the current state of the resource.
        capo_cloudextensions.errors.resource_not_found_exception.ResourceNotFoundException: The specified resource does not exist or the caller does not have permission to access it.
        capo_cloudextensions.errors.validation_exception.ValidationException: The request was malformed or contained invalid parameter values.
        capo_cloudextensions.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudextensions.types.update_profile_input.UpdateProfileInput]",
    ) -> OperationResponse[
        "capo_cloudextensions.types.update_profile_output.UpdateProfileOutput"
    ]:
        import capo_cloudextensions._operations.control_plane.update_profile

        output, http_response = (
            capo_cloudextensions._operations.control_plane.update_profile.update_profile(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_cloudextensions.types.update_profile_input.UpdateProfileInput",
    ) -> dict[str, Any]:
        import capo_cloudextensions.types.update_profile_input

        return capo_cloudextensions.types.update_profile_input.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_cloudextensions.types.update_profile_output.UpdateProfileOutput",
    ) -> dict[str, Any]:
        import capo_cloudextensions.types.update_profile_output

        return capo_cloudextensions.types.update_profile_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateProfile",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_cloudextensions.types.update_profile_input.UpdateProfileInput = {
        "identifier": identifier
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if extension_defaults is not None:
        input_["extension_defaults"] = extension_defaults

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