Skip to content

create_framework

create_framework(
    framework_name: FrameworkName,
    framework_controls: FrameworkControls,
    *,
    config_overrides: Optional[BackupClientConfig] = None,
    framework_description: Optional[FrameworkDescription] = None,
    idempotency_token: Optional[string] = None,
    framework_tags: Optional[stringMap] = None,
) -> CreateFrameworkOutput

Creates a framework with one or more controls. A framework is a collection of controls that you can use to evaluate your backup practices. By using pre-built customizable controls to define your policies, you can evaluate whether your backup practices comply with your policies and which resources are not yet in compliance.

Parameters:

  • framework_name (FrameworkName) –

    The unique name of the framework. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters (a-z, A-Z), numbers (0-9), and underscores (_).

  • framework_description (Optional[FrameworkDescription], default: None ) –

    An optional description of the framework with a maximum of 1,024 characters.

  • framework_controls (FrameworkControls) –

    The controls that make up the framework. Each control in the list has a name, input parameters, and scope.

  • idempotency_token (Optional[string], default: None ) –

    A customer-chosen string that you can use to distinguish between otherwise identical calls to CreateFrameworkInput. Retrying a successful request with the same idempotency token results in a success message with no action taken.

  • framework_tags (Optional[stringMap], default: None ) –

    The tags to assign to the framework.

Raises:

Source code in docs_src/capo_backup/_services/backup.py
def create_framework(
    self,
    framework_name: "capo_backup.types.framework_name.FrameworkName",
    framework_controls: "capo_backup.types.framework_controls.FrameworkControls",
    *,
    config_overrides: Optional[BackupClientConfig] = None,
    framework_description: Optional[
        "capo_backup.types.framework_description.FrameworkDescription"
    ] = None,
    idempotency_token: Optional["capo_backup.types.string.string"] = None,
    framework_tags: Optional["capo_backup.types.string_map.stringMap"] = None,
) -> "capo_backup.types.create_framework_output.CreateFrameworkOutput":
    """<p>Creates a framework with one or more controls. A framework is a collection of controls that you can use to evaluate your backup practices. By using pre-built customizable controls to define your policies, you can evaluate whether your backup practices comply with your policies and which resources are not yet in compliance.</p>

    Args:
        framework_name: <p>The unique name of the framework. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters (a-z, A-Z), numbers (0-9), and underscores (_).</p>
        framework_description: <p>An optional description of the framework with a maximum of 1,024 characters.</p>
        framework_controls: <p>The controls that make up the framework. Each control in the list has a name, input parameters, and scope.</p>
        idempotency_token: <p>A customer-chosen string that you can use to distinguish between otherwise identical calls to <code>CreateFrameworkInput</code>. Retrying a successful request with the same idempotency token results in a success message with no action taken.</p>
        framework_tags: <p>The tags to assign to the framework.</p>

    Raises:
        capo_backup.errors.already_exists_exception.AlreadyExistsException: <p>The required resource already exists.</p>
        capo_backup.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>Indicates that something is wrong with a parameter's value. For example, the value is out of range.</p>
        capo_backup.errors.limit_exceeded_exception.LimitExceededException: <p>A limit in the request has been exceeded; for example, a maximum number of items allowed in a request.</p>
        capo_backup.errors.missing_parameter_value_exception.MissingParameterValueException: <p>Indicates that a required parameter is missing.</p>
        capo_backup.errors.service_unavailable_exception.ServiceUnavailableException: <p>The request failed due to a temporary failure of the server.</p>
        capo_backup.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_backup.types.create_framework_input.CreateFrameworkInput]",
    ) -> OperationResponse[
        "capo_backup.types.create_framework_output.CreateFrameworkOutput"
    ]:
        import capo_backup._operations.cryo_controller_user_manager.create_framework

        output, http_response = (
            capo_backup._operations.cryo_controller_user_manager.create_framework.create_framework(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateFramework")
    )
    input_: capo_backup.types.create_framework_input.CreateFrameworkInput = {
        "framework_name": framework_name,
        "framework_controls": framework_controls,
    }
    if framework_description is not None:
        input_["framework_description"] = framework_description
    if idempotency_token is None:
        idempotency_token = str(uuid.uuid4())
    input_["idempotency_token"] = idempotency_token
    if framework_tags is not None:
        input_["framework_tags"] = framework_tags

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