Skip to content

create_core_definition

create_core_definition(
    *,
    config_overrides: Optional[GreengrassClientConfig] = None,
    amzn_client_token: Optional[__string] = None,
    initial_version: Optional[CoreDefinitionVersion] = None,
    name: Optional[__string] = None,
    tags: Optional[Tags] = None,
) -> CreateCoreDefinitionResponse

Creates a core definition. You may provide the initial version of the core definition now or use ''CreateCoreDefinitionVersion'' at a later time. Greengrass groups must each contain exactly one Greengrass core.

Parameters:

  • amzn_client_token (Optional[__string], default: None ) –

    A client token used to correlate requests and responses.

  • initial_version (Optional[CoreDefinitionVersion], default: None ) –

    Information about the initial version of the core definition.

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

    The name of the core definition.

  • tags (Optional[Tags], default: None ) –

    Tag(s) to add to the new resource.

Raises:

Source code in docs_src/capo_greengrass/_services/greengrass.py
def create_core_definition(
    self,
    *,
    config_overrides: Optional[GreengrassClientConfig] = None,
    amzn_client_token: Optional["capo_greengrass.types.__string.__string"] = None,
    initial_version: Optional[
        "capo_greengrass.types.core_definition_version.CoreDefinitionVersion"
    ] = None,
    name: Optional["capo_greengrass.types.__string.__string"] = None,
    tags: Optional["capo_greengrass.types.tags.Tags"] = None,
) -> "capo_greengrass.types.create_core_definition_response.CreateCoreDefinitionResponse":
    """Creates a core definition. You may provide the initial version of the core definition now or use ''CreateCoreDefinitionVersion'' at a later time. Greengrass groups must each contain exactly one Greengrass core.

    Args:
        amzn_client_token: A client token used to correlate requests and responses.
        initial_version: Information about the initial version of the core definition.
        name: The name of the core definition.
        tags: Tag(s) to add to the new resource.

    Raises:
        capo_greengrass.errors.bad_request_exception.BadRequestException: General error information.
        capo_greengrass.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_greengrass.types.create_core_definition_request.CreateCoreDefinitionRequest]",
    ) -> OperationResponse[
        "capo_greengrass.types.create_core_definition_response.CreateCoreDefinitionResponse"
    ]:
        import capo_greengrass._operations.greengrass.create_core_definition

        output, http_response = (
            capo_greengrass._operations.greengrass.create_core_definition.create_core_definition(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateCoreDefinition")
    )
    input_: capo_greengrass.types.create_core_definition_request.CreateCoreDefinitionRequest = {}
    if amzn_client_token is not None:
        input_["amzn_client_token"] = amzn_client_token
    if initial_version is not None:
        input_["initial_version"] = initial_version
    if name is not None:
        input_["name"] = name
    if tags is not None:
        input_["tags"] = tags

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