Creates a resource definition which contains a list of resources to be used in a group. You can create an initial version of the definition by providing a list of resources now, or use ''CreateResourceDefinitionVersion'' later.
Parameters:
-
amzn_client_token
(Optional[__string], default:
None
)
–
A client token used to correlate requests and responses.
-
initial_version
(Optional[ResourceDefinitionVersion], default:
None
)
–
Information about the initial version of the resource definition.
-
name
(Optional[__string], default:
None
)
–
The name of the resource definition.
-
tags
(Optional[Tags], default:
None
)
–
Tag(s) to add to the new resource.
Raises:
Source code in docs_src/capo_greengrass/_services/async_greengrass.py
| async def create_resource_definition(
self,
*,
config_overrides: Optional[AsyncGreengrassClientConfig] = None,
amzn_client_token: Optional["capo_greengrass.types.__string.__string"] = None,
initial_version: Optional[
"capo_greengrass.types.resource_definition_version.ResourceDefinitionVersion"
] = None,
name: Optional["capo_greengrass.types.__string.__string"] = None,
tags: Optional["capo_greengrass.types.tags.Tags"] = None,
) -> "capo_greengrass.types.create_resource_definition_response.CreateResourceDefinitionResponse":
"""Creates a resource definition which contains a list of resources to be used in a group. You can create an initial version of the definition by providing a list of resources now, or use ''CreateResourceDefinitionVersion'' later.
Args:
amzn_client_token: A client token used to correlate requests and responses.
initial_version: Information about the initial version of the resource definition.
name: The name of the resource 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.
"""
async def _handler(
req: "AsyncOperationRequest[capo_greengrass.types.create_resource_definition_request.CreateResourceDefinitionRequest]",
) -> AsyncOperationResponse[
"capo_greengrass.types.create_resource_definition_response.CreateResourceDefinitionResponse"
]:
import capo_greengrass._operations.greengrass.create_resource_definition
(
output,
http_response,
) = await capo_greengrass._operations.greengrass.create_resource_definition.async_create_resource_definition(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateResourceDefinition")
)
input_: capo_greengrass.types.create_resource_definition_request.CreateResourceDefinitionRequest = {}
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 = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|