Skip to content

create_share

create_share(
    resource_arn: str,
    principal_subscriber: str,
    *,
    config_overrides: Optional[OmicsClientConfig] = None,
    share_name: Optional[ShareName] = None,
) -> CreateShareResponse

Creates a cross-account shared resource. The resource owner makes an offer to share the resource with the principal subscriber (an Amazon Web Services user with a different account than the resource owner).

The following resources support cross-account sharing:

  • HealthOmics variant stores

  • HealthOmics annotation stores

  • Private workflows

Parameters:

  • resource_arn (str) –

    The ARN of the resource to be shared.

  • principal_subscriber (str) –

    The principal subscriber is the account being offered shared access to the resource.

  • share_name (Optional[ShareName], default: None ) –

    A name that the owner defines for the share.

Raises:

Source code in docs_src/capo_omics/_services/omics.py
def create_share(
    self,
    resource_arn: str,
    principal_subscriber: str,
    *,
    config_overrides: Optional[OmicsClientConfig] = None,
    share_name: Optional["capo_omics.types.share_name.ShareName"] = None,
) -> "capo_omics.types.create_share_response.CreateShareResponse":
    """<p>Creates a cross-account shared resource. The resource owner makes an offer to share the resource with the principal subscriber (an Amazon Web Services user with a different account than the resource owner).</p> <p>The following resources support cross-account sharing:</p> <ul> <li> <p>HealthOmics variant stores</p> </li> <li> <p>HealthOmics annotation stores</p> </li> <li> <p>Private workflows</p> </li> </ul>

    Args:
        resource_arn: <p>The ARN of the resource to be shared.</p>
        principal_subscriber: <p>The principal subscriber is the account being offered shared access to the resource. </p>
        share_name: <p>A name that the owner defines for the share.</p>

    Raises:
        capo_omics.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_omics.errors.conflict_exception.ConflictException: <p>The request cannot be applied to the target resource in its current state.</p>
        capo_omics.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred. Try the request again.</p>
        capo_omics.errors.resource_not_found_exception.ResourceNotFoundException: <p>The target resource was not found in the current Region.</p>
        capo_omics.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request exceeds a service quota.</p>
        capo_omics.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_omics.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_omics.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_omics.types.create_share_request.CreateShareRequest]",
    ) -> OperationResponse[
        "capo_omics.types.create_share_response.CreateShareResponse"
    ]:
        import capo_omics._operations.omics.create_share

        output, http_response = (
            capo_omics._operations.omics.create_share.create_share(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateShare")
    )
    input_: capo_omics.types.create_share_request.CreateShareRequest = {
        "resource_arn": resource_arn,
        "principal_subscriber": principal_subscriber,
    }
    if share_name is not None:
        input_["share_name"] = share_name

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