ResourceLimits Class

  • java.lang.Object
    • com.azure.resourcemanager.containerinstance.models.ResourceLimits

Implements

public final class ResourceLimits
implements JsonSerializable<ResourceLimits>

The resource limits.

Constructor Summary

Constructor Description
ResourceLimits()

Creates an instance of ResourceLimits class.

Method Summary

Modifier and Type Method and Description
Double cpu()

Get the cpu property: The CPU limit of this container instance.

static ResourceLimits fromJson(JsonReader jsonReader)

Reads an instance of ResourceLimits from the JsonReader.

GpuResource gpu()

Get the gpu property: The GPU limit of this container instance.

Double memoryInGB()

Get the memoryInGB property: The memory limit in GB of this container instance.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

ResourceLimits withCpu(Double cpu)

Set the cpu property: The CPU limit of this container instance.

ResourceLimits withGpu(GpuResource gpu)

Set the gpu property: The GPU limit of this container instance.

ResourceLimits withMemoryInGB(Double memoryInGB)

Set the memoryInGB property: The memory limit in GB of this container instance.

Methods inherited from java.lang.Object

Constructor Details

ResourceLimits

public ResourceLimits()

Creates an instance of ResourceLimits class.

Method Details

cpu

public Double cpu()

Get the cpu property: The CPU limit of this container instance.

Returns:

the cpu value.

fromJson

public static ResourceLimits fromJson(JsonReader jsonReader)

Reads an instance of ResourceLimits from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of ResourceLimits if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the ResourceLimits.

gpu

public GpuResource gpu()

Get the gpu property: The GPU limit of this container instance.

Returns:

the gpu value.

memoryInGB

public Double memoryInGB()

Get the memoryInGB property: The memory limit in GB of this container instance.

Returns:

the memoryInGB value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withCpu

public ResourceLimits withCpu(Double cpu)

Set the cpu property: The CPU limit of this container instance.

Parameters:

cpu - the cpu value to set.

Returns:

the ResourceLimits object itself.

withGpu

public ResourceLimits withGpu(GpuResource gpu)

Set the gpu property: The GPU limit of this container instance.

Parameters:

gpu - the gpu value to set.

Returns:

the ResourceLimits object itself.

withMemoryInGB

public ResourceLimits withMemoryInGB(Double memoryInGB)

Set the memoryInGB property: The memory limit in GB of this container instance.

Parameters:

memoryInGB - the memoryInGB value to set.

Returns:

the ResourceLimits object itself.

Applies to