Skip to content

update_portal_publish_status

update_portal_publish_status(
    portal_id: PortalId,
    status: DesiredPublishStatus,
    *,
    config_overrides: Optional[APIPortalClientConfig] = None,
    description: Optional[PublishDescription] = None,
) -> None

Publishes or disables a portal. The change runs asynchronously. Use GetPortal to track publishStatus.

Parameters:

  • portal_id (PortalId) –

    The identifier of the portal.

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

    A description of this publish request, up to 1024 characters.

Raises:

  • AccessDeniedException –

    You do not have permission to perform this operation.

  • BadRequestException –

    The request is not valid. The message identifies the field or value that failed validation.

  • ConflictException –

    The request conflicts with the current state of the resource, for example because another operation on it is still in progress.

  • LimitExceededException –

    The request rate or a service quota was exceeded. Reduce the request rate or the number of resources and try again.

  • ResourceNotFoundException –

    The requested resource does not exist, or you do not have access to it.

  • UnknownServiceError –

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

Source code in docs_src/capo_apiportal/_services/api_portal.py
def update_portal_publish_status(
    self,
    portal_id: "capo_apiportal.types.portal_id.PortalId",
    status: "capo_apiportal.types.desired_publish_status.DesiredPublishStatus",
    *,
    config_overrides: Optional[APIPortalClientConfig] = None,
    description: Optional[
        "capo_apiportal.types.publish_description.PublishDescription"
    ] = None,
) -> None:
    """Publishes or disables a portal. The change runs asynchronously. Use GetPortal to track `publishStatus`.

    Args:
        portal_id: The identifier of the portal.
        description: A description of this publish request, up to 1024 characters.

    Raises:
        capo_apiportal.errors.access_denied_exception.AccessDeniedException: You do not have permission to perform this operation.
        capo_apiportal.errors.bad_request_exception.BadRequestException: The request is not valid. The message identifies the field or value that failed validation.
        capo_apiportal.errors.conflict_exception.ConflictException: The request conflicts with the current state of the resource, for example because another operation on it is still in progress.
        capo_apiportal.errors.limit_exceeded_exception.LimitExceededException: The request rate or a service quota was exceeded. Reduce the request rate or the number of resources and try again.
        capo_apiportal.errors.resource_not_found_exception.ResourceNotFoundException: The requested resource does not exist, or you do not have access to it.
        capo_apiportal.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_apiportal.types.update_portal_publish_status_request.UpdatePortalPublishStatusRequest]",
    ) -> OperationResponse[None]:
        import capo_apiportal._operations.api_portal_control_service.update_portal_publish_status

        output, http_response = (
            capo_apiportal._operations.api_portal_control_service.update_portal_publish_status.update_portal_publish_status(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdatePortalPublishStatus")
    )
    input_: capo_apiportal.types.update_portal_publish_status_request.UpdatePortalPublishStatusRequest = {
        "portal_id": portal_id,
        "status": status,
    }
    if description is not None:
        input_["description"] = description

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