ContainerResourceRequirements Class
Defines the resource requirements for a container used by the Webservice.
ContainerResourceRequirement values are specified when deploying or updating a Webervice. For example, use the
deploy_configuration
or update
methods of the AksWebservice class, or
the create_version
, deploy_configuration
, or update_version
methods of
AksEndpoint class.
Initialize the container resource requirements.
- Inheritance
-
builtins.objectContainerResourceRequirements
Constructor
ContainerResourceRequirements(cpu, memory_in_gb, gpu=None, cpu_limit=None, memory_in_gb_limit=None)
Parameters
Name | Description |
---|---|
cpu
Required
|
The number of CPU cores to allocate for this Webservice. Can be a decimal. |
memory_in_gb
Required
|
The amount of memory (in GB) to allocate for this Webservice. Can be a decimal. |
cpu_limit
|
The max number of CPU cores this Webservice is allowed to use. Can be a decimal. Default value: None
|
memory_in_gb_limit
|
The max amount of memory (in GB) this Webservice is allowed to use. Can be a decimal. Default value: None
|
cpu
Required
|
The number of CPU cores to allocate for this Webservice. Can be a decimal. |
memory_in_gb
Required
|
The amount of memory (in GB) to allocate for this Webservice. Can be a decimal. |
cpu_limit
Required
|
The max number of CPU cores this Webservice is allowed to use. Can be a decimal. |
memory_in_gb_limit
Required
|
The max amount of memory (in GB) this Webservice is allowed to use. Can be a decimal. |
gpu
|
Default value: None
|
Variables
Name | Description |
---|---|
cpu
|
The number of CPU cores to allocate for this Webservice. Can be a decimal. |
memory_in_gb
|
The amount of memory (in GB) to allocate for this Webservice. Can be a decimal. |
cpu_limit
|
The max number of CPU cores this Webservice is allowed to use. Can be a decimal. |
memory_in_gb_limit
|
The max amount of memory (in GB) this Webservice is allowed to use. Can be a decimal. |
Methods
deserialize |
Convert a JSON object into a ContainerResourceRequirements object. |
serialize |
Convert this ContainerResourceRequirements object into a JSON serialized dictionary. |
deserialize
Convert a JSON object into a ContainerResourceRequirements object.
static deserialize(payload_obj)
Parameters
Name | Description |
---|---|
payload_obj
Required
|
A JSON object to convert to a ContainerResourceRequirements object. |
Returns
Type | Description |
---|---|
The ContainerResourceRequirements representation of the provided JSON object. |
serialize
Convert this ContainerResourceRequirements object into a JSON serialized dictionary.
serialize()
Returns
Type | Description |
---|---|
The JSON representation of this ContainerResourceRequirements. |