Skip to content

describe_workforce

describe_workforce(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    workforce_name: Optional[WorkforceName] = None,
) -> DescribeWorkforceResponse

Lists private workforce information, including workforce name, Amazon Resource Name (ARN), and, if applicable, allowed IP address ranges (CIDRs). Allowable IP address ranges are the IP addresses that workers can use to access tasks.

This operation applies only to private workforces.

Parameters:

  • workforce_name (Optional[WorkforceName], default: None ) –

    The name of the private workforce whose access you want to restrict. WorkforceName is automatically set to default when a workforce is created and cannot be modified.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def describe_workforce(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    workforce_name: Optional[
        "capo_sagemaker.types.workforce_name.WorkforceName"
    ] = None,
) -> "capo_sagemaker.types.describe_workforce_response.DescribeWorkforceResponse":
    """<p>Lists private workforce information, including workforce name, Amazon Resource Name (ARN), and, if applicable, allowed IP address ranges (<a href="https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html">CIDRs</a>). Allowable IP address ranges are the IP addresses that workers can use to access tasks. </p> <important> <p>This operation applies only to private workforces.</p> </important>

    Args:
        workforce_name: <p>The name of the private workforce whose access you want to restrict. <code>WorkforceName</code> is automatically set to <code>default</code> when a workforce is created and cannot be modified. </p>

    Raises:
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.describe_workforce_request.DescribeWorkforceRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.describe_workforce_response.DescribeWorkforceResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.describe_workforce

        output, http_response = (
            capo_sagemaker._operations.sage_maker.describe_workforce.describe_workforce(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeWorkforce")
    )
    input_: capo_sagemaker.types.describe_workforce_request.DescribeWorkforceRequest = {}
    if workforce_name is not None:
        input_["workforce_name"] = workforce_name

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