Documentation
¶
Index ¶
- type AzureFileVolume
- type CachedImages
- type CachedImagesListResult
- type Capabilities
- type CapabilitiesCapabilities
- type CapabilitiesListResult
- type ClientFactory
- func (c *ClientFactory) NewContainerGroupsClient() *ContainerGroupsClient
- func (c *ClientFactory) NewContainersClient() *ContainersClient
- func (c *ClientFactory) NewLocationClient() *LocationClient
- func (c *ClientFactory) NewOperationsClient() *OperationsClient
- func (c *ClientFactory) NewSubnetServiceAssociationLinkClient() *SubnetServiceAssociationLinkClient
- type ConfidentialComputeProperties
- type Container
- type ContainerAttachResponse
- type ContainerExec
- type ContainerExecRequest
- type ContainerExecRequestTerminalSize
- type ContainerExecResponse
- type ContainerGroup
- type ContainerGroupDiagnostics
- type ContainerGroupIPAddressType
- type ContainerGroupIdentity
- type ContainerGroupListResult
- type ContainerGroupNetworkProtocol
- type ContainerGroupPriority
- type ContainerGroupProperties
- type ContainerGroupPropertiesInstanceView
- type ContainerGroupPropertiesProperties
- type ContainerGroupRestartPolicy
- type ContainerGroupSKU
- type ContainerGroupSubnetID
- type ContainerGroupsClient
- func (client *ContainerGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, containerGroupName string, ...) (*runtime.Poller[ContainerGroupsClientCreateOrUpdateResponse], error)
- func (client *ContainerGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, containerGroupName string, ...) (*runtime.Poller[ContainerGroupsClientDeleteResponse], error)
- func (client *ContainerGroupsClient) BeginRestart(ctx context.Context, resourceGroupName string, containerGroupName string, ...) (*runtime.Poller[ContainerGroupsClientRestartResponse], error)
- func (client *ContainerGroupsClient) BeginStart(ctx context.Context, resourceGroupName string, containerGroupName string, ...) (*runtime.Poller[ContainerGroupsClientStartResponse], error)
- func (client *ContainerGroupsClient) Get(ctx context.Context, resourceGroupName string, containerGroupName string, ...) (ContainerGroupsClientGetResponse, error)
- func (client *ContainerGroupsClient) GetOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, containerGroupName string, ...) (ContainerGroupsClientGetOutboundNetworkDependenciesEndpointsResponse, error)
- func (client *ContainerGroupsClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[ContainerGroupsClientListByResourceGroupResponse]
- func (client *ContainerGroupsClient) NewListPager(options *ContainerGroupsClientListOptions) *runtime.Pager[ContainerGroupsClientListResponse]
- func (client *ContainerGroupsClient) Stop(ctx context.Context, resourceGroupName string, containerGroupName string, ...) (ContainerGroupsClientStopResponse, error)
- func (client *ContainerGroupsClient) Update(ctx context.Context, resourceGroupName string, containerGroupName string, ...) (ContainerGroupsClientUpdateResponse, error)
- type ContainerGroupsClientBeginCreateOrUpdateOptions
- type ContainerGroupsClientBeginDeleteOptions
- type ContainerGroupsClientBeginRestartOptions
- type ContainerGroupsClientBeginStartOptions
- type ContainerGroupsClientCreateOrUpdateResponse
- type ContainerGroupsClientDeleteResponse
- type ContainerGroupsClientGetOptions
- type ContainerGroupsClientGetOutboundNetworkDependenciesEndpointsOptions
- type ContainerGroupsClientGetOutboundNetworkDependenciesEndpointsResponse
- type ContainerGroupsClientGetResponse
- type ContainerGroupsClientListByResourceGroupOptions
- type ContainerGroupsClientListByResourceGroupResponse
- type ContainerGroupsClientListOptions
- type ContainerGroupsClientListResponse
- type ContainerGroupsClientRestartResponse
- type ContainerGroupsClientStartResponse
- type ContainerGroupsClientStopOptions
- type ContainerGroupsClientStopResponse
- type ContainerGroupsClientUpdateOptions
- type ContainerGroupsClientUpdateResponse
- type ContainerHTTPGet
- type ContainerInstanceOperationsOrigin
- type ContainerNetworkProtocol
- type ContainerPort
- type ContainerProbe
- type ContainerProperties
- type ContainerPropertiesInstanceView
- type ContainerState
- type ContainersClient
- func (client *ContainersClient) Attach(ctx context.Context, resourceGroupName string, containerGroupName string, ...) (ContainersClientAttachResponse, error)
- func (client *ContainersClient) ExecuteCommand(ctx context.Context, resourceGroupName string, containerGroupName string, ...) (ContainersClientExecuteCommandResponse, error)
- func (client *ContainersClient) ListLogs(ctx context.Context, resourceGroupName string, containerGroupName string, ...) (ContainersClientListLogsResponse, error)
- type ContainersClientAttachOptions
- type ContainersClientAttachResponse
- type ContainersClientExecuteCommandOptions
- type ContainersClientExecuteCommandResponse
- type ContainersClientListLogsOptions
- type ContainersClientListLogsResponse
- type DNSConfiguration
- type DNSNameLabelReusePolicy
- type DeploymentExtensionSpec
- type DeploymentExtensionSpecProperties
- type EncryptionProperties
- type EnvironmentVariable
- type Event
- type GitRepoVolume
- type GpuResource
- type GpuSKU
- type HTTPHeader
- type IPAddress
- type ImageRegistryCredential
- type InitContainerDefinition
- type InitContainerPropertiesDefinition
- type InitContainerPropertiesDefinitionInstanceView
- type LocationClient
- func (client *LocationClient) NewListCachedImagesPager(location string, options *LocationClientListCachedImagesOptions) *runtime.Pager[LocationClientListCachedImagesResponse]
- func (client *LocationClient) NewListCapabilitiesPager(location string, options *LocationClientListCapabilitiesOptions) *runtime.Pager[LocationClientListCapabilitiesResponse]
- func (client *LocationClient) NewListUsagePager(location string, options *LocationClientListUsageOptions) *runtime.Pager[LocationClientListUsageResponse]
- type LocationClientListCachedImagesOptions
- type LocationClientListCachedImagesResponse
- type LocationClientListCapabilitiesOptions
- type LocationClientListCapabilitiesResponse
- type LocationClientListUsageOptions
- type LocationClientListUsageResponse
- type LogAnalytics
- type LogAnalyticsLogType
- type Logs
- type OperatingSystemTypes
- type Operation
- type OperationDisplay
- type OperationListResult
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type Port
- type Resource
- type ResourceIdentityType
- type ResourceLimits
- type ResourceRequests
- type ResourceRequirements
- type Scheme
- type SecurityContextCapabilitiesDefinition
- type SecurityContextDefinition
- type SubnetServiceAssociationLinkClient
- type SubnetServiceAssociationLinkClientBeginDeleteOptions
- type SubnetServiceAssociationLinkClientDeleteResponse
- type Usage
- type UsageListResult
- type UsageName
- type UserAssignedIdentities
- type Volume
- type VolumeMount
Examples ¶
- ContainerGroupsClient.BeginCreateOrUpdate (ConfidentialContainerGroup)
- ContainerGroupsClient.BeginCreateOrUpdate (ContainerGroupCreateWithExtensions)
- ContainerGroupsClient.BeginCreateOrUpdate (ContainerGroupWithEncryptionProperties)
- ContainerGroupsClient.BeginCreateOrUpdate (ContainerGroupsCreateOrUpdate)
- ContainerGroupsClient.BeginCreateOrUpdate (ContainerGroupsCreateWithPriority)
- ContainerGroupsClient.BeginDelete
- ContainerGroupsClient.BeginRestart
- ContainerGroupsClient.BeginStart
- ContainerGroupsClient.Get (ContainerGroupsGetFailed)
- ContainerGroupsClient.Get (ContainerGroupsGetSucceeded)
- ContainerGroupsClient.Get (ContainerGroupsGetWithPriority)
- ContainerGroupsClient.NewListByResourceGroupPager
- ContainerGroupsClient.NewListPager
- ContainerGroupsClient.Stop
- ContainerGroupsClient.Update
- ContainersClient.Attach
- ContainersClient.ExecuteCommand
- ContainersClient.ListLogs
- LocationClient.NewListCachedImagesPager
- LocationClient.NewListCapabilitiesPager
- LocationClient.NewListUsagePager
- OperationsClient.NewListPager
- SubnetServiceAssociationLinkClient.BeginDelete
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AzureFileVolume ¶
type AzureFileVolume struct { string // REQUIRED; The name of the storage account that contains the Azure File share. StorageAccountName *string // The flag indicating whether the Azure File shared mounted as a volume is read-only. ReadOnly *bool // The storage account access key used to access the Azure File share. StorageAccountKey *string }ShareName *
AzureFileVolume - The properties of the Azure File volume. Azure File shares are mounted as volumes.
func (AzureFileVolume) MarshalJSON ¶
func (a AzureFileVolume) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureFileVolume.
func (*AzureFileVolume) UnmarshalJSON ¶
func (a *AzureFileVolume) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureFileVolume.
type CachedImages ¶
type CachedImages struct { // REQUIRED; The cached image name. Image *string // REQUIRED; The OS type of the cached image. OSType *string }
CachedImages - The cached image and OS type.
func (CachedImages) MarshalJSON ¶
func (c CachedImages) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CachedImages.
func (*CachedImages) UnmarshalJSON ¶
func (c *CachedImages) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CachedImages.
type CachedImagesListResult ¶
type CachedImagesListResult struct { // The URI to fetch the next page of cached images. NextLink *string // The list of cached images. Value []*CachedImages }
CachedImagesListResult - The response containing cached images.
func (CachedImagesListResult) MarshalJSON ¶
func (c CachedImagesListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CachedImagesListResult.
func (*CachedImagesListResult) UnmarshalJSON ¶
func (c *CachedImagesListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CachedImagesListResult.
type Capabilities ¶
type Capabilities struct { // READ-ONLY; The supported capabilities. Capabilities *CapabilitiesCapabilities // READ-ONLY; The GPU sku that this capability describes. Gpu *string // READ-ONLY; The ip address type that this capability describes. IPAddressType *string // READ-ONLY; The resource location. Location *string // READ-ONLY; The OS type that this capability describes. OSType *string // READ-ONLY; The resource type that this capability describes. ResourceType *string }
Capabilities - The regional capabilities.
func (Capabilities) MarshalJSON ¶
func (c Capabilities) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Capabilities.
func (*Capabilities) UnmarshalJSON ¶
func (c *Capabilities) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Capabilities.
type CapabilitiesCapabilities ¶
type CapabilitiesCapabilities struct { // READ-ONLY; The maximum allowed CPU request in cores. MaxCPU *float32 // READ-ONLY; The maximum allowed GPU count. MaxGpuCount *float32 // READ-ONLY; The maximum allowed memory request in GB. MaxMemoryInGB *float32 }
CapabilitiesCapabilities - The supported capabilities.
func (CapabilitiesCapabilities) MarshalJSON ¶
func (c CapabilitiesCapabilities) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapabilitiesCapabilities.
func (*CapabilitiesCapabilities) UnmarshalJSON ¶
func (c *CapabilitiesCapabilities) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapabilitiesCapabilities.
type CapabilitiesListResult ¶
type CapabilitiesListResult struct { // The URI to fetch the next page of capabilities. NextLink *string // The list of capabilities. Value []*Capabilities }
CapabilitiesListResult - The response containing list of capabilities.
func (CapabilitiesListResult) MarshalJSON ¶
func (c CapabilitiesListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CapabilitiesListResult.
func (*CapabilitiesListResult) UnmarshalJSON ¶
func (c *CapabilitiesListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CapabilitiesListResult.
type ClientFactory ¶ added in v2.2.0
type ClientFactory struct {
// contains filtered or unexported fields
}
ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.
func NewClientFactory ¶ added in v2.2.0
func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)
NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.
- subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ClientFactory) NewContainerGroupsClient ¶ added in v2.2.0
func (c *ClientFactory) NewContainerGroupsClient() *ContainerGroupsClient
NewContainerGroupsClient creates a new instance of ContainerGroupsClient.
func (*ClientFactory) NewContainersClient ¶ added in v2.2.0
func (c *ClientFactory) NewContainersClient() *ContainersClient
NewContainersClient creates a new instance of ContainersClient.
func (*ClientFactory) NewLocationClient ¶ added in v2.2.0
func (c *ClientFactory) NewLocationClient() *LocationClient
NewLocationClient creates a new instance of LocationClient.
func (*ClientFactory) NewOperationsClient ¶ added in v2.2.0
func (c *ClientFactory) NewOperationsClient() *OperationsClient
NewOperationsClient creates a new instance of OperationsClient.
func (*ClientFactory) NewSubnetServiceAssociationLinkClient ¶ added in v2.2.0
func (c *ClientFactory) NewSubnetServiceAssociationLinkClient() *SubnetServiceAssociationLinkClient
NewSubnetServiceAssociationLinkClient creates a new instance of SubnetServiceAssociationLinkClient.
type ConfidentialComputeProperties ¶ added in v2.3.0
type ConfidentialComputeProperties struct { // The base64 encoded confidential compute enforcement policy CcePolicy *string }
ConfidentialComputeProperties - The properties for confidential container group
func (ConfidentialComputeProperties) MarshalJSON ¶ added in v2.3.0
func (c ConfidentialComputeProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ConfidentialComputeProperties.
func (*ConfidentialComputeProperties) UnmarshalJSON ¶ added in v2.3.0
func (c *ConfidentialComputeProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ConfidentialComputeProperties.
type Container ¶
type Container struct { // REQUIRED; The user-provided name of the container instance. Name *string // REQUIRED; The properties of the container instance. Properties *ContainerProperties }
Container - A container instance.
func (Container) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Container.
func (*Container) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Container.
type ContainerAttachResponse ¶
type ContainerAttachResponse struct { // The password to the output stream from the attach. Send as an Authorization header value when connecting to the websocketUri. Password *string // The uri for the output stream from the attach. WebSocketURI *string }
ContainerAttachResponse - The information for the output stream from container attach.
func (ContainerAttachResponse) MarshalJSON ¶
func (c ContainerAttachResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerAttachResponse.
func (*ContainerAttachResponse) UnmarshalJSON ¶
func (c *ContainerAttachResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAttachResponse.
type ContainerExec ¶
type ContainerExec struct { // The commands to execute within the container. Command []*string }
ContainerExec - The container execution command, for liveness or readiness probe
func (ContainerExec) MarshalJSON ¶
func (c ContainerExec) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerExec.
func (*ContainerExec) UnmarshalJSON ¶
func (c *ContainerExec) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerExec.
type ContainerExecRequest ¶
type ContainerExecRequest struct { // The command to be executed. Command *string // The size of the terminal. TerminalSize *ContainerExecRequestTerminalSize }
ContainerExecRequest - The container exec request.
func (ContainerExecRequest) MarshalJSON ¶
func (c ContainerExecRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerExecRequest.
func (*ContainerExecRequest) UnmarshalJSON ¶
func (c *ContainerExecRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerExecRequest.
type ContainerExecRequestTerminalSize ¶
type ContainerExecRequestTerminalSize struct { // The column size of the terminal Cols *int32 // The row size of the terminal Rows *int32 }
ContainerExecRequestTerminalSize - The size of the terminal.
func (ContainerExecRequestTerminalSize) MarshalJSON ¶
func (c ContainerExecRequestTerminalSize) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerExecRequestTerminalSize.
func (*ContainerExecRequestTerminalSize) UnmarshalJSON ¶
func (c *ContainerExecRequestTerminalSize) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerExecRequestTerminalSize.
type ContainerExecResponse ¶
type ContainerExecResponse struct { // The password to start the exec command. Password *string // The uri for the exec websocket. WebSocketURI *string }
ContainerExecResponse - The information for the container exec command.
func (ContainerExecResponse) MarshalJSON ¶
func (c ContainerExecResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerExecResponse.
func (*ContainerExecResponse) UnmarshalJSON ¶
func (c *ContainerExecResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerExecResponse.
type ContainerGroup ¶
type ContainerGroup struct { // REQUIRED; The container group properties Properties *ContainerGroupPropertiesProperties // The identity of the container group, if configured. Identity *ContainerGroupIdentity // The resource location. Location *string // The resource tags. Tags map[string]*string // The zones for the container group. Zones []*string // READ-ONLY; The resource id. ID *string // READ-ONLY; The resource name. Name *string // READ-ONLY; The resource type. Type *string }
ContainerGroup - A container group.
func (ContainerGroup) MarshalJSON ¶
func (c ContainerGroup) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerGroup.
func (*ContainerGroup) UnmarshalJSON ¶
func (c *ContainerGroup) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerGroup.
type ContainerGroupDiagnostics ¶
type ContainerGroupDiagnostics struct { // Container group log analytics information. LogAnalytics *LogAnalytics }
ContainerGroupDiagnostics - Container group diagnostic information.
func (ContainerGroupDiagnostics) MarshalJSON ¶
func (c ContainerGroupDiagnostics) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerGroupDiagnostics.
func (*ContainerGroupDiagnostics) UnmarshalJSON ¶
func (c *ContainerGroupDiagnostics) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerGroupDiagnostics.
type ContainerGroupIPAddressType ¶
type ContainerGroupIPAddressType string
ContainerGroupIPAddressType - Specifies if the IP is exposed to the public internet or private VNET.
const ( ContainerGroupIPAddressTypePrivate ContainerGroupIPAddressType = "Private" ContainerGroupIPAddressTypePublic ContainerGroupIPAddressType = "Public" )
func PossibleContainerGroupIPAddressTypeValues ¶
func PossibleContainerGroupIPAddressTypeValues() []ContainerGroupIPAddressType
PossibleContainerGroupIPAddressTypeValues returns the possible values for the ContainerGroupIPAddressType const type.
type ContainerGroupIdentity ¶
type ContainerGroupIdentity struct { // The type of identity used for the container group. The type 'SystemAssigned, UserAssigned' includes both an implicitly // created identity and a set of user assigned identities. The type 'None' will // remove any identities from the container group. Type *ResourceIdentityType // The list of user identities associated with the container group. UserAssignedIdentities map[string]*UserAssignedIdentities // READ-ONLY; The principal id of the container group identity. This property will only be provided for a system assigned // identity. PrincipalID *string // READ-ONLY; The tenant id associated with the container group. This property will only be provided for a system assigned // identity. TenantID *string }
ContainerGroupIdentity - Identity for the container group.
func (ContainerGroupIdentity) MarshalJSON ¶
func (c ContainerGroupIdentity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerGroupIdentity.
func (*ContainerGroupIdentity) UnmarshalJSON ¶
func (c *ContainerGroupIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerGroupIdentity.
type ContainerGroupListResult ¶
type ContainerGroupListResult struct { // The URI to fetch the next page of container groups. NextLink *string // The list of container groups. Value []*ContainerGroup }
ContainerGroupListResult - The container group list response that contains the container group properties.
func (ContainerGroupListResult) MarshalJSON ¶
func (c ContainerGroupListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerGroupListResult.
func (*ContainerGroupListResult) UnmarshalJSON ¶
func (c *ContainerGroupListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerGroupListResult.
type ContainerGroupNetworkProtocol ¶
type ContainerGroupNetworkProtocol string
ContainerGroupNetworkProtocol - The protocol associated with the port.
const ( ContainerGroupNetworkProtocolTCP ContainerGroupNetworkProtocol = "TCP" ContainerGroupNetworkProtocolUDP ContainerGroupNetworkProtocol = "UDP" )
func PossibleContainerGroupNetworkProtocolValues ¶
func PossibleContainerGroupNetworkProtocolValues() []ContainerGroupNetworkProtocol
PossibleContainerGroupNetworkProtocolValues returns the possible values for the ContainerGroupNetworkProtocol const type.
type ContainerGroupPriority ¶ added in v2.3.0
type ContainerGroupPriority string
ContainerGroupPriority - The priority of the container group.
const ( ContainerGroupPriorityRegular ContainerGroupPriority = "Regular" ContainerGroupPrioritySpot ContainerGroupPriority = "Spot" )
func PossibleContainerGroupPriorityValues ¶ added in v2.3.0
func PossibleContainerGroupPriorityValues() []ContainerGroupPriority
PossibleContainerGroupPriorityValues returns the possible values for the ContainerGroupPriority const type.
type ContainerGroupProperties ¶
type ContainerGroupProperties struct { // REQUIRED; The container group properties Properties *ContainerGroupPropertiesProperties // The identity of the container group, if configured. Identity *ContainerGroupIdentity }
ContainerGroupProperties - The container group properties
func (ContainerGroupProperties) MarshalJSON ¶
func (c ContainerGroupProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerGroupProperties.
func (*ContainerGroupProperties) UnmarshalJSON ¶
func (c *ContainerGroupProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerGroupProperties.
type ContainerGroupPropertiesInstanceView ¶
type ContainerGroupPropertiesInstanceView struct { // READ-ONLY; The events of this container group. Events []*Event // READ-ONLY; The state of the container group. Only valid in response. State *string }
ContainerGroupPropertiesInstanceView - The instance view of the container group. Only valid in response.
func (ContainerGroupPropertiesInstanceView) MarshalJSON ¶
func (c ContainerGroupPropertiesInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerGroupPropertiesInstanceView.
func (*ContainerGroupPropertiesInstanceView) UnmarshalJSON ¶
func (c *ContainerGroupPropertiesInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerGroupPropertiesInstanceView.
type ContainerGroupPropertiesProperties ¶
type ContainerGroupPropertiesProperties struct { // REQUIRED; The containers within the container group. Containers []*Container // REQUIRED; The operating system type required by the containers in the container group. OSType *OperatingSystemTypes // The properties for confidential container group ConfidentialComputeProperties *ConfidentialComputeProperties // The DNS config information for a container group. DNSConfig *DNSConfiguration // The diagnostic information for a container group. Diagnostics *ContainerGroupDiagnostics // The encryption properties for a container group. EncryptionProperties *EncryptionProperties // extensions used by virtual kubelet Extensions []*DeploymentExtensionSpec // The IP address type of the container group. IPAddress *IPAddress // The image registry credentials by which the container group is created from. ImageRegistryCredentials []*ImageRegistryCredential // The init containers for a container group. InitContainers []*InitContainerDefinition // The priority of the container group. Priority *ContainerGroupPriority // Restart policy for all containers within the container group. // * Always Always restart // * OnFailure Restart on failure // * Never Never restart RestartPolicy *ContainerGroupRestartPolicy // The SKU for a container group. SKU *ContainerGroupSKU // The subnet resource IDs for a container group. SubnetIDs []*ContainerGroupSubnetID // The list of volumes that can be mounted by containers in this container group. Volumes []*Volume // READ-ONLY; The instance view of the container group. Only valid in response. InstanceView *ContainerGroupPropertiesInstanceView // READ-ONLY; The provisioning state of the container group. This only appears in the response. ProvisioningState *string }
ContainerGroupPropertiesProperties - The container group properties
func (ContainerGroupPropertiesProperties) MarshalJSON ¶
func (c ContainerGroupPropertiesProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerGroupPropertiesProperties.
func (*ContainerGroupPropertiesProperties) UnmarshalJSON ¶
func (c *ContainerGroupPropertiesProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerGroupPropertiesProperties.
type ContainerGroupRestartPolicy ¶
type ContainerGroupRestartPolicy string
ContainerGroupRestartPolicy - Restart policy for all containers within the container group. * Always Always restart * OnFailure Restart on failure * Never Never restart
const ( ContainerGroupRestartPolicyAlways ContainerGroupRestartPolicy = "Always" ContainerGroupRestartPolicyNever ContainerGroupRestartPolicy = "Never" ContainerGroupRestartPolicyOnFailure ContainerGroupRestartPolicy = "OnFailure" )
func PossibleContainerGroupRestartPolicyValues ¶
func PossibleContainerGroupRestartPolicyValues() []ContainerGroupRestartPolicy
PossibleContainerGroupRestartPolicyValues returns the possible values for the ContainerGroupRestartPolicy const type.
type ContainerGroupSKU ¶
type ContainerGroupSKU string
ContainerGroupSKU - The container group SKU.
const ( ContainerGroupSKUConfidential ContainerGroupSKU = "Confidential" ContainerGroupSKUDedicated ContainerGroupSKU = "Dedicated" ContainerGroupSKUStandard ContainerGroupSKU = "Standard" )
func PossibleContainerGroupSKUValues ¶
func PossibleContainerGroupSKUValues() []ContainerGroupSKU
PossibleContainerGroupSKUValues returns the possible values for the ContainerGroupSKU const type.
type ContainerGroupSubnetID ¶
type ContainerGroupSubnetID struct { // REQUIRED; Resource ID of virtual network and subnet. ID *string // Friendly name for the subnet. Name *string }
ContainerGroupSubnetID - Container group subnet information.
func (ContainerGroupSubnetID) MarshalJSON ¶
func (c ContainerGroupSubnetID) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerGroupSubnetID.
func (*ContainerGroupSubnetID) UnmarshalJSON ¶
func (c *ContainerGroupSubnetID) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerGroupSubnetID.
type ContainerGroupsClient ¶
type ContainerGroupsClient struct {
// contains filtered or unexported fields
}
ContainerGroupsClient contains the methods for the ContainerGroups group. Don't use this type directly, use NewContainerGroupsClient() instead.
func NewContainerGroupsClient ¶
func NewContainerGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContainerGroupsClient, error)
NewContainerGroupsClient creates a new instance of ContainerGroupsClient with the specified values.
- subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ContainerGroupsClient) BeginCreateOrUpdate ¶
func (client *ContainerGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, containerGroupName string, containerGroup ContainerGroup, options *ContainerGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ContainerGroupsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Create or update container groups with specified configurations. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-05-01
- resourceGroupName - The name of the resource group.
- containerGroupName - The name of the container group.
- containerGroup - The properties of the container group to be created or updated.
- options - ContainerGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainerGroupsClient.BeginCreateOrUpdate method.
Example (ConfidentialContainerGroup) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupCreateConfidential.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewContainerGroupsClient().BeginCreateOrUpdate(ctx, "demo", "demo1", armcontainerinstance.ContainerGroup{ Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{ ConfidentialComputeProperties: &armcontainerinstance.ConfidentialComputeProperties{ CcePolicy: to.Ptr("eyJhbGxvd19hbGwiOiB0cnVlLCAiY29udGFpbmVycyI6IHsibGVuZ3RoIjogMCwgImVsZW1lbnRzIjogbnVsbH19"), }, Containers: []*armcontainerinstance.Container{ { Name: to.Ptr("accdemo"), Properties: &armcontainerinstance.ContainerProperties{ Command: []*string{}, EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{}, Image: to.Ptr("confiimage"), Ports: []*armcontainerinstance.ContainerPort{ { Port: to.Ptr[int32](8000), }}, Resources: &armcontainerinstance.ResourceRequirements{ Requests: &armcontainerinstance.ResourceRequests{ CPU: to.Ptr[float64](1), MemoryInGB: to.Ptr[float64](1.5), }, }, SecurityContext: &armcontainerinstance.SecurityContextDefinition{ Capabilities: &armcontainerinstance.SecurityContextCapabilitiesDefinition{ Add: []*string{ to.Ptr("CAP_NET_ADMIN")}, }, Privileged: to.Ptr(false), }, }, }}, ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{}, IPAddress: &armcontainerinstance.IPAddress{ Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic), Ports: []*armcontainerinstance.Port{ { Port: to.Ptr[int32](8000), Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP), }}, }, OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux), SKU: to.Ptr(armcontainerinstance.ContainerGroupSKUConfidential), }, Location: to.Ptr("westeurope"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ContainerGroup = armcontainerinstance.ContainerGroup{ // Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{ // ConfidentialComputeProperties: &armcontainerinstance.ConfidentialComputeProperties{ // CcePolicy: to.Ptr("eyJhbGxvd19hbGwiOiB0cnVlLCAiY29udGFpbmVycyI6IHsibGVuZ3RoIjogMCwgImVsZW1lbnRzIjogbnVsbH19"), // }, // Containers: []*armcontainerinstance.Container{ // { // Name: to.Ptr("accdemo"), // Properties: &armcontainerinstance.ContainerProperties{ // Command: []*string{ // }, // EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{ // }, // Image: to.Ptr("confiimage"), // Ports: []*armcontainerinstance.ContainerPort{ // { // Port: to.Ptr[int32](8000), // }}, // Resources: &armcontainerinstance.ResourceRequirements{ // Requests: &armcontainerinstance.ResourceRequests{ // CPU: to.Ptr[float64](1), // MemoryInGB: to.Ptr[float64](1.5), // }, // }, // SecurityContext: &armcontainerinstance.SecurityContextDefinition{ // Capabilities: &armcontainerinstance.SecurityContextCapabilitiesDefinition{ // Add: []*string{ // to.Ptr("CAP_NET_ADMIN")}, // }, // Privileged: to.Ptr(false), // }, // }, // }}, // ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{ // }, // InitContainers: []*armcontainerinstance.InitContainerDefinition{ // }, // InstanceView: &armcontainerinstance.ContainerGroupPropertiesInstanceView{ // Events: []*armcontainerinstance.Event{ // }, // State: to.Ptr("Running"), // }, // IPAddress: &armcontainerinstance.IPAddress{ // Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic), // Ports: []*armcontainerinstance.Port{ // { // Port: to.Ptr[int32](8000), // Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP), // }}, // }, // OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux), // ProvisioningState: to.Ptr("Succeeded"), // SKU: to.Ptr(armcontainerinstance.ContainerGroupSKUConfidential), // }, // Name: to.Ptr("demo1"), // Type: to.Ptr("Microsoft.ContainerInstance/containerGroups"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.ContainerInstance/containerGroups/demo1"), // Location: to.Ptr("westeurope"), // }
Output:
Example (ContainerGroupCreateWithExtensions) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupExtensions.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewContainerGroupsClient().BeginCreateOrUpdate(ctx, "demo", "demo1", armcontainerinstance.ContainerGroup{ Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{ Containers: []*armcontainerinstance.Container{ { Name: to.Ptr("demo1"), Properties: &armcontainerinstance.ContainerProperties{ Command: []*string{}, EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{}, Image: to.Ptr("nginx"), Ports: []*armcontainerinstance.ContainerPort{ { Port: to.Ptr[int32](80), }}, Resources: &armcontainerinstance.ResourceRequirements{ Requests: &armcontainerinstance.ResourceRequests{ CPU: to.Ptr[float64](1), MemoryInGB: to.Ptr[float64](1.5), }, }, }, }}, ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{}, IPAddress: &armcontainerinstance.IPAddress{ Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePrivate), Ports: []*armcontainerinstance.Port{ { Port: to.Ptr[int32](80), Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP), }}, }, OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux), SubnetIDs: []*armcontainerinstance.ContainerGroupSubnetID{ { ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-rg-vnet/subnets/test-subnet"), }}, Extensions: []*armcontainerinstance.DeploymentExtensionSpec{ { Name: to.Ptr("kube-proxy"), Properties: &armcontainerinstance.DeploymentExtensionSpecProperties{ ExtensionType: to.Ptr("kube-proxy"), ProtectedSettings: map[string]any{ "kubeConfig": "<kubeconfig encoded string>", }, Settings: map[string]any{ "clusterCidr": "10.240.0.0/16", "kubeVersion": "v1.9.10", }, Version: to.Ptr("1.0"), }, }, { Name: to.Ptr("vk-realtime-metrics"), Properties: &armcontainerinstance.DeploymentExtensionSpecProperties{ ExtensionType: to.Ptr("realtime-metrics"), Version: to.Ptr("1.0"), }, }}, }, Location: to.Ptr("eastus2"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ContainerGroup = armcontainerinstance.ContainerGroup{ // Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{ // Containers: []*armcontainerinstance.Container{ // { // Name: to.Ptr("demo1"), // Properties: &armcontainerinstance.ContainerProperties{ // Command: []*string{ // }, // EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{ // }, // Image: to.Ptr("nginx"), // Ports: []*armcontainerinstance.ContainerPort{ // { // Port: to.Ptr[int32](80), // }}, // Resources: &armcontainerinstance.ResourceRequirements{ // Requests: &armcontainerinstance.ResourceRequests{ // CPU: to.Ptr[float64](1), // MemoryInGB: to.Ptr[float64](1.5), // }, // }, // }, // }}, // ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{ // }, // InitContainers: []*armcontainerinstance.InitContainerDefinition{ // }, // InstanceView: &armcontainerinstance.ContainerGroupPropertiesInstanceView{ // Events: []*armcontainerinstance.Event{ // }, // State: to.Ptr("Pending"), // }, // OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux), // ProvisioningState: to.Ptr("Succeeded"), // SKU: to.Ptr(armcontainerinstance.ContainerGroupSKUStandard), // SubnetIDs: []*armcontainerinstance.ContainerGroupSubnetID{ // { // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-rg-vnet/subnets/test-subnet"), // }}, // Extensions: []*armcontainerinstance.DeploymentExtensionSpec{ // { // Name: to.Ptr("kube-proxy"), // Properties: &armcontainerinstance.DeploymentExtensionSpecProperties{ // ExtensionType: to.Ptr("kube-proxy"), // Settings: map[string]any{ // "clusterCidr": "10.240.0.0/16", // "kubeVersion": "v1.9.10", // }, // Version: to.Ptr("1.0"), // }, // }, // { // Name: to.Ptr("vk-realtime-metrics"), // Properties: &armcontainerinstance.DeploymentExtensionSpecProperties{ // ExtensionType: to.Ptr("realtime-metrics"), // Version: to.Ptr("1.0"), // }, // }}, // }, // Name: to.Ptr("demo1"), // Type: to.Ptr("Microsoft.ContainerInstance/containerGroups"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/test-rg/providers/Microsoft.ContainerInstance/containerGroups/demo1"), // Location: to.Ptr("eastus2"), // }
Output:
Example (ContainerGroupWithEncryptionProperties) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupEncryptionProperties.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewContainerGroupsClient().BeginCreateOrUpdate(ctx, "demo", "demo1", armcontainerinstance.ContainerGroup{ Identity: &armcontainerinstance.ContainerGroupIdentity{ Type: to.Ptr(armcontainerinstance.ResourceIdentityTypeUserAssigned), UserAssignedIdentities: map[string]*armcontainerinstance.UserAssignedIdentities{ "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity": {}, }, }, Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{ Containers: []*armcontainerinstance.Container{ { Name: to.Ptr("demo1"), Properties: &armcontainerinstance.ContainerProperties{ Command: []*string{}, EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{}, Image: to.Ptr("nginx"), Ports: []*armcontainerinstance.ContainerPort{ { Port: to.Ptr[int32](80), }}, Resources: &armcontainerinstance.ResourceRequirements{ Requests: &armcontainerinstance.ResourceRequests{ CPU: to.Ptr[float64](1), MemoryInGB: to.Ptr[float64](1.5), }, }, }, }}, EncryptionProperties: &armcontainerinstance.EncryptionProperties{ Identity: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity"), KeyName: to.Ptr("test-key"), KeyVersion: to.Ptr("<key version>"), VaultBaseURL: to.Ptr("https://testkeyvault.vault.azure.net"), }, ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{}, IPAddress: &armcontainerinstance.IPAddress{ Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic), Ports: []*armcontainerinstance.Port{ { Port: to.Ptr[int32](80), Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP), }}, }, OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux), }, Location: to.Ptr("eastus2"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ContainerGroup = armcontainerinstance.ContainerGroup{ // Identity: &armcontainerinstance.ContainerGroupIdentity{ // Type: to.Ptr(armcontainerinstance.ResourceIdentityTypeUserAssigned), // TenantID: to.Ptr("<tenant id>"), // UserAssignedIdentities: map[string]*armcontainerinstance.UserAssignedIdentities{ // "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity": &armcontainerinstance.UserAssignedIdentities{ // ClientID: to.Ptr("<client id>"), // PrincipalID: to.Ptr("<principal id>"), // }, // }, // }, // Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{ // Containers: []*armcontainerinstance.Container{ // { // Name: to.Ptr("demo1"), // Properties: &armcontainerinstance.ContainerProperties{ // Command: []*string{ // }, // EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{ // }, // Image: to.Ptr("nginx"), // Ports: []*armcontainerinstance.ContainerPort{ // { // Port: to.Ptr[int32](80), // }}, // Resources: &armcontainerinstance.ResourceRequirements{ // Requests: &armcontainerinstance.ResourceRequests{ // CPU: to.Ptr[float64](1), // MemoryInGB: to.Ptr[float64](1.5), // }, // }, // }, // }}, // EncryptionProperties: &armcontainerinstance.EncryptionProperties{ // Identity: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/container-group-identity"), // KeyName: to.Ptr("test-key"), // KeyVersion: to.Ptr("<key version>"), // VaultBaseURL: to.Ptr("https://testkeyvault.vault.azure.net/"), // }, // ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{ // }, // InitContainers: []*armcontainerinstance.InitContainerDefinition{ // }, // InstanceView: &armcontainerinstance.ContainerGroupPropertiesInstanceView{ // Events: []*armcontainerinstance.Event{ // }, // State: to.Ptr("Pending"), // }, // IPAddress: &armcontainerinstance.IPAddress{ // Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic), // Ports: []*armcontainerinstance.Port{ // { // Port: to.Ptr[int32](80), // Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP), // }}, // }, // OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux), // ProvisioningState: to.Ptr("Succeeded"), // SKU: to.Ptr(armcontainerinstance.ContainerGroupSKUStandard), // }, // Name: to.Ptr("demo1"), // Type: to.Ptr("Microsoft.ContainerInstance/containerGroups"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/Microsoft.ContainerInstance/containerGroups/demo1"), // Location: to.Ptr("eastus2"), // }
Output:
Example (ContainerGroupsCreateOrUpdate) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsCreateOrUpdate.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewContainerGroupsClient().BeginCreateOrUpdate(ctx, "demo", "demo1", armcontainerinstance.ContainerGroup{ Identity: &armcontainerinstance.ContainerGroupIdentity{ Type: to.Ptr(armcontainerinstance.ResourceIdentityTypeSystemAssignedUserAssigned), UserAssignedIdentities: map[string]*armcontainerinstance.UserAssignedIdentities{ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name": {}, }, }, Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{ Containers: []*armcontainerinstance.Container{ { Name: to.Ptr("demo1"), Properties: &armcontainerinstance.ContainerProperties{ Command: []*string{}, EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{}, Image: to.Ptr("nginx"), Ports: []*armcontainerinstance.ContainerPort{ { Port: to.Ptr[int32](80), }}, Resources: &armcontainerinstance.ResourceRequirements{ Requests: &armcontainerinstance.ResourceRequests{ CPU: to.Ptr[float64](1), Gpu: &armcontainerinstance.GpuResource{ Count: to.Ptr[int32](1), SKU: to.Ptr(armcontainerinstance.GpuSKUK80), }, MemoryInGB: to.Ptr[float64](1.5), }, }, VolumeMounts: []*armcontainerinstance.VolumeMount{ { Name: to.Ptr("volume1"), MountPath: to.Ptr("/mnt/volume1"), ReadOnly: to.Ptr(false), }, { Name: to.Ptr("volume2"), MountPath: to.Ptr("/mnt/volume2"), ReadOnly: to.Ptr(false), }, { Name: to.Ptr("volume3"), MountPath: to.Ptr("/mnt/volume3"), ReadOnly: to.Ptr(true), }}, }, }}, Diagnostics: &armcontainerinstance.ContainerGroupDiagnostics{ LogAnalytics: &armcontainerinstance.LogAnalytics{ LogType: to.Ptr(armcontainerinstance.LogAnalyticsLogTypeContainerInsights), Metadata: map[string]*string{ "test-key": to.Ptr("test-metadata-value"), }, WorkspaceID: to.Ptr("workspaceid"), WorkspaceKey: to.Ptr("workspaceKey"), WorkspaceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/microsoft.operationalinsights/workspaces/workspace"), }, }, DNSConfig: &armcontainerinstance.DNSConfiguration{ NameServers: []*string{ to.Ptr("1.1.1.1")}, Options: to.Ptr("ndots:2"), SearchDomains: to.Ptr("cluster.local svc.cluster.local"), }, ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{}, IPAddress: &armcontainerinstance.IPAddress{ Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic), AutoGeneratedDomainNameLabelScope: to.Ptr(armcontainerinstance.DNSNameLabelReusePolicyUnsecure), DNSNameLabel: to.Ptr("dnsnamelabel1"), Ports: []*armcontainerinstance.Port{ { Port: to.Ptr[int32](80), Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP), }}, }, OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux), SubnetIDs: []*armcontainerinstance.ContainerGroupSubnetID{ { ID: to.Ptr("[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]"), }}, Volumes: []*armcontainerinstance.Volume{ { Name: to.Ptr("volume1"), AzureFile: &armcontainerinstance.AzureFileVolume{ ShareName: to.Ptr("shareName"), StorageAccountKey: to.Ptr("accountKey"), StorageAccountName: to.Ptr("accountName"), }, }, { Name: to.Ptr("volume2"), EmptyDir: map[string]any{}, }, { Name: to.Ptr("volume3"), Secret: map[string]*string{ "secretKey1": to.Ptr("SecretValue1InBase64"), "secretKey2": to.Ptr("SecretValue2InBase64"), }, }}, }, Location: to.Ptr("west us"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ContainerGroup = armcontainerinstance.ContainerGroup{ // Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{ // Containers: []*armcontainerinstance.Container{ // { // Name: to.Ptr("demo1"), // Properties: &armcontainerinstance.ContainerProperties{ // Command: []*string{ // }, // EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{ // }, // Image: to.Ptr("nginx"), // Ports: []*armcontainerinstance.ContainerPort{ // { // Port: to.Ptr[int32](80), // }}, // Resources: &armcontainerinstance.ResourceRequirements{ // Requests: &armcontainerinstance.ResourceRequests{ // CPU: to.Ptr[float64](1), // Gpu: &armcontainerinstance.GpuResource{ // Count: to.Ptr[int32](1), // SKU: to.Ptr(armcontainerinstance.GpuSKUK80), // }, // MemoryInGB: to.Ptr[float64](1.5), // }, // }, // VolumeMounts: []*armcontainerinstance.VolumeMount{ // { // Name: to.Ptr("volume1"), // MountPath: to.Ptr("/mnt/volume1"), // ReadOnly: to.Ptr(false), // }, // { // Name: to.Ptr("volume2"), // MountPath: to.Ptr("/mnt/volume2"), // ReadOnly: to.Ptr(false), // }, // { // Name: to.Ptr("volume3"), // MountPath: to.Ptr("/mnt/volume3"), // ReadOnly: to.Ptr(true), // }}, // }, // }}, // Diagnostics: &armcontainerinstance.ContainerGroupDiagnostics{ // LogAnalytics: &armcontainerinstance.LogAnalytics{ // WorkspaceID: to.Ptr("workspaceid"), // }, // }, // DNSConfig: &armcontainerinstance.DNSConfiguration{ // NameServers: []*string{ // to.Ptr("1.1.1.1")}, // Options: to.Ptr("ndots:2"), // SearchDomains: to.Ptr("cluster.local svc.cluster.local"), // }, // ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{ // }, // IPAddress: &armcontainerinstance.IPAddress{ // Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic), // AutoGeneratedDomainNameLabelScope: to.Ptr(armcontainerinstance.DNSNameLabelReusePolicyUnsecure), // DNSNameLabel: to.Ptr("dnsnamelabel1"), // Fqdn: to.Ptr("dnsnamelabel1.azure-container.io"), // IP: to.Ptr("10.0.0.1"), // Ports: []*armcontainerinstance.Port{ // { // Port: to.Ptr[int32](80), // Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP), // }}, // }, // OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux), // ProvisioningState: to.Ptr("Succeeded"), // Volumes: []*armcontainerinstance.Volume{ // { // Name: to.Ptr("volume1"), // AzureFile: &armcontainerinstance.AzureFileVolume{ // ShareName: to.Ptr("shareName"), // StorageAccountName: to.Ptr("accountName"), // }, // }, // { // Name: to.Ptr("volume2"), // EmptyDir: map[string]any{ // }, // }, // { // Name: to.Ptr("volume3"), // Secret: map[string]*string{ // }, // }}, // }, // Name: to.Ptr("demo1"), // Type: to.Ptr("Microsoft.ContainerInstance/containerGroups"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1"), // Location: to.Ptr("WestUs"), // Zones: []*string{ // to.Ptr("1")}, // }
Output:
Example (ContainerGroupsCreateWithPriority) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsCreatePriority.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewContainerGroupsClient().BeginCreateOrUpdate(ctx, "demo", "demo1", armcontainerinstance.ContainerGroup{ Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{ Containers: []*armcontainerinstance.Container{ { Name: to.Ptr("test-container-001"), Properties: &armcontainerinstance.ContainerProperties{ Command: []*string{ to.Ptr("/bin/sh"), to.Ptr("-c"), to.Ptr("sleep 10")}, Image: to.Ptr("alpine:latest"), Resources: &armcontainerinstance.ResourceRequirements{ Requests: &armcontainerinstance.ResourceRequests{ CPU: to.Ptr[float64](1), MemoryInGB: to.Ptr[float64](1), }, }, }, }}, OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux), Priority: to.Ptr(armcontainerinstance.ContainerGroupPrioritySpot), RestartPolicy: to.Ptr(armcontainerinstance.ContainerGroupRestartPolicyNever), SKU: to.Ptr(armcontainerinstance.ContainerGroupSKUStandard), }, Location: to.Ptr("eastus"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ContainerGroup = armcontainerinstance.ContainerGroup{ // Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{ // Containers: []*armcontainerinstance.Container{ // { // Name: to.Ptr("test-container-001"), // Properties: &armcontainerinstance.ContainerProperties{ // Command: []*string{ // to.Ptr("/bin/sh"), // to.Ptr("-c"), // to.Ptr("sleep 10")}, // EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{ // }, // Image: to.Ptr("alpine:latest"), // Ports: []*armcontainerinstance.ContainerPort{ // }, // Resources: &armcontainerinstance.ResourceRequirements{ // Requests: &armcontainerinstance.ResourceRequests{ // CPU: to.Ptr[float64](1), // MemoryInGB: to.Ptr[float64](1), // }, // }, // }, // }}, // InitContainers: []*armcontainerinstance.InitContainerDefinition{ // }, // InstanceView: &armcontainerinstance.ContainerGroupPropertiesInstanceView{ // Events: []*armcontainerinstance.Event{ // }, // State: to.Ptr("Succeeded"), // }, // OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux), // Priority: to.Ptr(armcontainerinstance.ContainerGroupPrioritySpot), // ProvisioningState: to.Ptr("Succeeded"), // RestartPolicy: to.Ptr(armcontainerinstance.ContainerGroupRestartPolicyNever), // SKU: to.Ptr(armcontainerinstance.ContainerGroupSKUStandard), // }, // Name: to.Ptr("demo1"), // Type: to.Ptr("Microsoft.ContainerInstance/containerGroups"), // ID: to.Ptr("/subscriptions/subId/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1"), // Location: to.Ptr("eastus"), // }
Output:
func (*ContainerGroupsClient) BeginDelete ¶
func (client *ContainerGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, containerGroupName string, options *ContainerGroupsClientBeginDeleteOptions) (*runtime.Poller[ContainerGroupsClientDeleteResponse], error)
BeginDelete - Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-05-01
- resourceGroupName - The name of the resource group.
- containerGroupName - The name of the container group.
- options - ContainerGroupsClientBeginDeleteOptions contains the optional parameters for the ContainerGroupsClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsDelete.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewContainerGroupsClient().BeginDelete(ctx, "demo", "demo1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ContainerGroup = armcontainerinstance.ContainerGroup{ // Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{ // Containers: []*armcontainerinstance.Container{ // { // Name: to.Ptr("demo1"), // Properties: &armcontainerinstance.ContainerProperties{ // Command: []*string{ // }, // EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{ // }, // Image: to.Ptr("nginx"), // Ports: []*armcontainerinstance.ContainerPort{ // { // Port: to.Ptr[int32](80), // }}, // Resources: &armcontainerinstance.ResourceRequirements{ // Requests: &armcontainerinstance.ResourceRequests{ // CPU: to.Ptr[float64](1), // MemoryInGB: to.Ptr[float64](1.5), // }, // }, // VolumeMounts: []*armcontainerinstance.VolumeMount{ // { // Name: to.Ptr("volume1"), // MountPath: to.Ptr("/mnt/volume1"), // ReadOnly: to.Ptr(false), // }}, // }, // }}, // ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{ // { // Server: to.Ptr("azcloudconsoleregistry.azurecr.io"), // Username: to.Ptr("azcloudconsoleregistry"), // }}, // IPAddress: &armcontainerinstance.IPAddress{ // Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic), // IP: to.Ptr("10.0.0.1"), // Ports: []*armcontainerinstance.Port{ // { // Port: to.Ptr[int32](80), // Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP), // }}, // }, // OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux), // ProvisioningState: to.Ptr("Succeeded"), // Volumes: []*armcontainerinstance.Volume{ // { // Name: to.Ptr("volume1"), // AzureFile: &armcontainerinstance.AzureFileVolume{ // ReadOnly: to.Ptr(false), // ShareName: to.Ptr("share1"), // StorageAccountName: to.Ptr("storage1"), // }, // }}, // }, // Name: to.Ptr("demo1"), // Type: to.Ptr("Microsoft.ContainerInstance/containerGroups"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1"), // Location: to.Ptr("WestUs"), // Zones: []*string{ // to.Ptr("1")}, // }
Output:
func (*ContainerGroupsClient) BeginRestart ¶
func (client *ContainerGroupsClient) BeginRestart(ctx context.Context, resourceGroupName string, containerGroupName string, options *ContainerGroupsClientBeginRestartOptions) (*runtime.Poller[ContainerGroupsClientRestartResponse], error)
BeginRestart - Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-05-01
- resourceGroupName - The name of the resource group.
- containerGroupName - The name of the container group.
- options - ContainerGroupsClientBeginRestartOptions contains the optional parameters for the ContainerGroupsClient.BeginRestart method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsRestart.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewContainerGroupsClient().BeginRestart(ctx, "demo", "demo1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*ContainerGroupsClient) BeginStart ¶
func (client *ContainerGroupsClient) BeginStart(ctx context.Context, resourceGroupName string, containerGroupName string, options *ContainerGroupsClientBeginStartOptions) (*runtime.Poller[ContainerGroupsClientStartResponse], error)
BeginStart - Starts all containers in a container group. Compute resources will be allocated and billing will start. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-05-01
- resourceGroupName - The name of the resource group.
- containerGroupName - The name of the container group.
- options - ContainerGroupsClientBeginStartOptions contains the optional parameters for the ContainerGroupsClient.BeginStart method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsStart.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewContainerGroupsClient().BeginStart(ctx, "demo", "demo1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
func (*ContainerGroupsClient) Get ¶
func (client *ContainerGroupsClient) Get(ctx context.Context, resourceGroupName string, containerGroupName string, options *ContainerGroupsClientGetOptions) (ContainerGroupsClientGetResponse, error)
Get - Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-05-01
- resourceGroupName - The name of the resource group.
- containerGroupName - The name of the container group.
- options - ContainerGroupsClientGetOptions contains the optional parameters for the ContainerGroupsClient.Get method.
Example (ContainerGroupsGetFailed) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsGet_Failed.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewContainerGroupsClient().Get(ctx, "demo", "demo1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ContainerGroup = armcontainerinstance.ContainerGroup{ // Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{ // Containers: []*armcontainerinstance.Container{ // { // Name: to.Ptr("demo1"), // Properties: &armcontainerinstance.ContainerProperties{ // Command: []*string{ // }, // EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{ // }, // Image: to.Ptr("nginx"), // InstanceView: &armcontainerinstance.ContainerPropertiesInstanceView{ // CurrentState: &armcontainerinstance.ContainerState{ // DetailStatus: to.Ptr(""), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-08T00:09:10.000Z"); return t}()), // State: to.Ptr("Waiting"), // }, // Events: []*armcontainerinstance.Event{ // { // Name: to.Ptr("Pulling"), // Type: to.Ptr("Normal"), // Count: to.Ptr[int32](1), // FirstTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-08T00:09:01.000Z"); return t}()), // LastTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-08T00:09:01.000Z"); return t}()), // Message: to.Ptr("pulling image \"nginx\""), // }, // { // Name: to.Ptr("Pulled"), // Type: to.Ptr("Normal"), // Count: to.Ptr[int32](1), // FirstTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-08T00:09:10.000Z"); return t}()), // LastTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-08T00:09:10.000Z"); return t}()), // Message: to.Ptr("Successfully pulled image \"nginx\""), // }}, // RestartCount: to.Ptr[int32](0), // }, // Ports: []*armcontainerinstance.ContainerPort{ // { // Port: to.Ptr[int32](80), // }}, // Resources: &armcontainerinstance.ResourceRequirements{ // Requests: &armcontainerinstance.ResourceRequests{ // CPU: to.Ptr[float64](1), // MemoryInGB: to.Ptr[float64](1.5), // }, // }, // VolumeMounts: []*armcontainerinstance.VolumeMount{ // { // Name: to.Ptr("volume1"), // MountPath: to.Ptr("/mnt/volume1"), // ReadOnly: to.Ptr(false), // }}, // }, // }}, // ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{ // { // Server: to.Ptr("azcloudconsoleregistry.azurecr.io"), // Username: to.Ptr("azcloudconsoleregistry"), // }}, // InstanceView: &armcontainerinstance.ContainerGroupPropertiesInstanceView{ // Events: []*armcontainerinstance.Event{ // { // Name: to.Ptr("FailedMount"), // Type: to.Ptr("Normal"), // Count: to.Ptr[int32](1), // FirstTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-08T00:19:10.000Z"); return t}()), // LastTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-08T00:19:10.000Z"); return t}()), // Message: to.Ptr("Output: mount error(2): Permission denied"), // }}, // State: to.Ptr("Pending"), // }, // IPAddress: &armcontainerinstance.IPAddress{ // Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic), // IP: to.Ptr("10.0.0.1"), // Ports: []*armcontainerinstance.Port{ // { // Port: to.Ptr[int32](80), // Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP), // }}, // }, // OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux), // ProvisioningState: to.Ptr("Succeeded"), // Volumes: []*armcontainerinstance.Volume{ // { // Name: to.Ptr("volume1"), // AzureFile: &armcontainerinstance.AzureFileVolume{ // ReadOnly: to.Ptr(false), // ShareName: to.Ptr("share1"), // StorageAccountName: to.Ptr("storage1"), // }, // }}, // }, // Name: to.Ptr("demo1"), // Type: to.Ptr("Microsoft.ContainerInstance/containerGroups"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1"), // Location: to.Ptr("WestUs"), // }
Output:
Example (ContainerGroupsGetSucceeded) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsGet_Succeeded.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewContainerGroupsClient().Get(ctx, "demo", "demo1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ContainerGroup = armcontainerinstance.ContainerGroup{ // Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{ // Containers: []*armcontainerinstance.Container{ // { // Name: to.Ptr("demo1"), // Properties: &armcontainerinstance.ContainerProperties{ // Command: []*string{ // }, // EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{ // }, // Image: to.Ptr("nginx"), // Ports: []*armcontainerinstance.ContainerPort{ // { // Port: to.Ptr[int32](80), // }}, // Resources: &armcontainerinstance.ResourceRequirements{ // Requests: &armcontainerinstance.ResourceRequests{ // CPU: to.Ptr[float64](1), // MemoryInGB: to.Ptr[float64](1.5), // }, // }, // VolumeMounts: []*armcontainerinstance.VolumeMount{ // { // Name: to.Ptr("volume1"), // MountPath: to.Ptr("/mnt/volume1"), // ReadOnly: to.Ptr(false), // }}, // }, // }}, // ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{ // { // Server: to.Ptr("azcloudconsoleregistry.azurecr.io"), // Username: to.Ptr("azcloudconsoleregistry"), // }}, // IPAddress: &armcontainerinstance.IPAddress{ // Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic), // IP: to.Ptr("10.0.0.1"), // Ports: []*armcontainerinstance.Port{ // { // Port: to.Ptr[int32](80), // Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP), // }}, // }, // OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux), // ProvisioningState: to.Ptr("Succeeded"), // Volumes: []*armcontainerinstance.Volume{ // { // Name: to.Ptr("volume1"), // AzureFile: &armcontainerinstance.AzureFileVolume{ // ReadOnly: to.Ptr(false), // ShareName: to.Ptr("share1"), // StorageAccountName: to.Ptr("storage1"), // }, // }}, // }, // Name: to.Ptr("demo1"), // Type: to.Ptr("Microsoft.ContainerInstance/containerGroups"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1"), // Location: to.Ptr("WestUs"), // Zones: []*string{ // to.Ptr("1")}, // }
Output:
Example (ContainerGroupsGetWithPriority) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsGetPriority.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewContainerGroupsClient().Get(ctx, "demo", "demo1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ContainerGroup = armcontainerinstance.ContainerGroup{ // Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{ // Containers: []*armcontainerinstance.Container{ // { // Name: to.Ptr("test-container-001"), // Properties: &armcontainerinstance.ContainerProperties{ // Command: []*string{ // to.Ptr("/bin/sh"), // to.Ptr("-c"), // to.Ptr("sleep 10")}, // EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{ // }, // Image: to.Ptr("alpine:latest"), // InstanceView: &armcontainerinstance.ContainerPropertiesInstanceView{ // CurrentState: &armcontainerinstance.ContainerState{ // DetailStatus: to.Ptr("Completed"), // ExitCode: to.Ptr[int32](0), // FinishTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-11T19:33:55.565Z"); return t}()), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-11T19:33:44.217Z"); return t}()), // State: to.Ptr("Terminated"), // }, // Events: []*armcontainerinstance.Event{ // { // Name: to.Ptr("Pulling"), // Type: to.Ptr("Normal"), // Count: to.Ptr[int32](2), // FirstTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-11T19:28:22.000Z"); return t}()), // LastTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-11T19:32:09.000Z"); return t}()), // Message: to.Ptr("pulling image \"alpine@sha256:1304f174557314a7ed9eddb4eab12fed12cb0cd9809e4c28f29af86979a3c870\""), // }, // { // Name: to.Ptr("Pulled"), // Type: to.Ptr("Normal"), // Count: to.Ptr[int32](2), // FirstTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-11T19:32:08.000Z"); return t}()), // LastTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-11T19:32:38.000Z"); return t}()), // Message: to.Ptr("Successfully pulled image \"alpine@sha256:1304f174557314a7ed9eddb4eab12fed12cb0cd9809e4c28f29af86979a3c870\""), // }, // { // Name: to.Ptr("Started"), // Type: to.Ptr("Normal"), // Count: to.Ptr[int32](1), // FirstTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-11T19:33:44.000Z"); return t}()), // LastTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-11T19:33:44.000Z"); return t}()), // Message: to.Ptr("Started container"), // }}, // RestartCount: to.Ptr[int32](0), // }, // Ports: []*armcontainerinstance.ContainerPort{ // }, // Resources: &armcontainerinstance.ResourceRequirements{ // Requests: &armcontainerinstance.ResourceRequests{ // CPU: to.Ptr[float64](1), // MemoryInGB: to.Ptr[float64](1), // }, // }, // }, // }}, // InitContainers: []*armcontainerinstance.InitContainerDefinition{ // }, // InstanceView: &armcontainerinstance.ContainerGroupPropertiesInstanceView{ // Events: []*armcontainerinstance.Event{ // }, // State: to.Ptr("Succeeded"), // }, // OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux), // Priority: to.Ptr(armcontainerinstance.ContainerGroupPrioritySpot), // ProvisioningState: to.Ptr("Succeeded"), // RestartPolicy: to.Ptr(armcontainerinstance.ContainerGroupRestartPolicyNever), // SKU: to.Ptr(armcontainerinstance.ContainerGroupSKUStandard), // }, // Name: to.Ptr("demo1"), // Type: to.Ptr("Microsoft.ContainerInstance/containerGroups"), // ID: to.Ptr("/subscriptions/subId/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1"), // Location: to.Ptr("eastus"), // }
Output:
func (*ContainerGroupsClient) GetOutboundNetworkDependenciesEndpoints ¶
func (client *ContainerGroupsClient) GetOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, containerGroupName string, options *ContainerGroupsClientGetOutboundNetworkDependenciesEndpointsOptions) (ContainerGroupsClientGetOutboundNetworkDependenciesEndpointsResponse, error)
GetOutboundNetworkDependenciesEndpoints - Gets all the network dependencies for this container group to allow complete control of network setting and configuration. For container groups, this will always be an empty list. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-05-01
- resourceGroupName - The name of the resource group.
- containerGroupName - The name of the container group.
- options - ContainerGroupsClientGetOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the ContainerGroupsClient.GetOutboundNetworkDependenciesEndpoints method.
func (*ContainerGroupsClient) NewListByResourceGroupPager ¶
func (client *ContainerGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *ContainerGroupsClientListByResourceGroupOptions) *runtime.Pager[ContainerGroupsClientListByResourceGroupResponse]
NewListByResourceGroupPager - Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes.
Generated from API version 2023-05-01
- resourceGroupName - The name of the resource group.
- options - ContainerGroupsClientListByResourceGroupOptions contains the optional parameters for the ContainerGroupsClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsListByResourceGroup.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewContainerGroupsClient().NewListByResourceGroupPager("demo", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.ContainerGroupListResult = armcontainerinstance.ContainerGroupListResult{ // Value: []*armcontainerinstance.ContainerGroup{ // { // Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{ // Containers: []*armcontainerinstance.Container{ // { // Name: to.Ptr("demo1"), // Properties: &armcontainerinstance.ContainerProperties{ // Command: []*string{ // }, // EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{ // }, // Image: to.Ptr("nginx"), // Ports: []*armcontainerinstance.ContainerPort{ // { // Port: to.Ptr[int32](80), // }}, // Resources: &armcontainerinstance.ResourceRequirements{ // Requests: &armcontainerinstance.ResourceRequests{ // CPU: to.Ptr[float64](1), // MemoryInGB: to.Ptr[float64](1.5), // }, // }, // VolumeMounts: []*armcontainerinstance.VolumeMount{ // { // Name: to.Ptr("volume1"), // MountPath: to.Ptr("/mnt/volume1"), // ReadOnly: to.Ptr(false), // }}, // }, // }}, // ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{ // { // Server: to.Ptr("azcloudconsoleregistry.azurecr.io"), // Username: to.Ptr("azcloudconsoleregistry"), // }}, // IPAddress: &armcontainerinstance.IPAddress{ // Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic), // IP: to.Ptr("10.0.0.1"), // Ports: []*armcontainerinstance.Port{ // { // Port: to.Ptr[int32](80), // Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP), // }}, // }, // OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux), // ProvisioningState: to.Ptr("Succeeded"), // Volumes: []*armcontainerinstance.Volume{ // { // Name: to.Ptr("volume1"), // AzureFile: &armcontainerinstance.AzureFileVolume{ // ReadOnly: to.Ptr(false), // ShareName: to.Ptr("share1"), // StorageAccountName: to.Ptr("storage1"), // }, // }}, // }, // Name: to.Ptr("demo1"), // Type: to.Ptr("Microsoft.ContainerInstance/containerGroups"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1"), // Location: to.Ptr("WestUs"), // Zones: []*string{ // to.Ptr("1")}, // }}, // } }
Output:
func (*ContainerGroupsClient) NewListPager ¶
func (client *ContainerGroupsClient) NewListPager(options *ContainerGroupsClientListOptions) *runtime.Pager[ContainerGroupsClientListResponse]
NewListPager - Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes.
Generated from API version 2023-05-01
- options - ContainerGroupsClientListOptions contains the optional parameters for the ContainerGroupsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsList.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewContainerGroupsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.ContainerGroupListResult = armcontainerinstance.ContainerGroupListResult{ // Value: []*armcontainerinstance.ContainerGroup{ // { // Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{ // Containers: []*armcontainerinstance.Container{ // { // Name: to.Ptr("demo1"), // Properties: &armcontainerinstance.ContainerProperties{ // Command: []*string{ // }, // EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{ // }, // Image: to.Ptr("nginx"), // InstanceView: &armcontainerinstance.ContainerPropertiesInstanceView{ // CurrentState: &armcontainerinstance.ContainerState{ // DetailStatus: to.Ptr(""), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-17T17:27:21.000Z"); return t}()), // State: to.Ptr("Running"), // }, // Events: []*armcontainerinstance.Event{ // }, // RestartCount: to.Ptr[int32](0), // }, // Ports: []*armcontainerinstance.ContainerPort{ // { // Port: to.Ptr[int32](80), // }}, // Resources: &armcontainerinstance.ResourceRequirements{ // Requests: &armcontainerinstance.ResourceRequests{ // CPU: to.Ptr[float64](1), // MemoryInGB: to.Ptr[float64](1.5), // }, // }, // VolumeMounts: []*armcontainerinstance.VolumeMount{ // { // Name: to.Ptr("volume1"), // MountPath: to.Ptr("/mnt/volume1"), // ReadOnly: to.Ptr(false), // }}, // }, // }}, // ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{ // { // Server: to.Ptr("azcloudconsoleregistry.azurecr.io"), // Username: to.Ptr("azcloudconsoleregistry"), // }}, // IPAddress: &armcontainerinstance.IPAddress{ // Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic), // IP: to.Ptr("10.0.0.1"), // Ports: []*armcontainerinstance.Port{ // { // Port: to.Ptr[int32](80), // Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP), // }}, // }, // OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux), // ProvisioningState: to.Ptr("Succeeded"), // Volumes: []*armcontainerinstance.Volume{ // { // Name: to.Ptr("volume1"), // AzureFile: &armcontainerinstance.AzureFileVolume{ // ReadOnly: to.Ptr(false), // ShareName: to.Ptr("share1"), // StorageAccountName: to.Ptr("storage1"), // }, // }}, // }, // Name: to.Ptr("demo1"), // Type: to.Ptr("Microsoft.ContainerInstance/containerGroups"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1"), // Location: to.Ptr("WestUs"), // Zones: []*string{ // to.Ptr("1")}, // }}, // } }
Output:
func (*ContainerGroupsClient) Stop ¶
func (client *ContainerGroupsClient) Stop(ctx context.Context, resourceGroupName string, containerGroupName string, options *ContainerGroupsClientStopOptions) (ContainerGroupsClientStopResponse, error)
Stop - Stops all containers in a container group. Compute resources will be deallocated and billing will stop. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-05-01
- resourceGroupName - The name of the resource group.
- containerGroupName - The name of the container group.
- options - ContainerGroupsClientStopOptions contains the optional parameters for the ContainerGroupsClient.Stop method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsStop.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewContainerGroupsClient().Stop(ctx, "demo", "demo1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) }
Output:
func (*ContainerGroupsClient) Update ¶
func (client *ContainerGroupsClient) Update(ctx context.Context, resourceGroupName string, containerGroupName string, resource Resource, options *ContainerGroupsClientUpdateOptions) (ContainerGroupsClientUpdateResponse, error)
Update - Updates container group tags with specified values. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-05-01
- resourceGroupName - The name of the resource group.
- containerGroupName - The name of the container group.
- resource - The container group resource with just the tags to be updated.
- options - ContainerGroupsClientUpdateOptions contains the optional parameters for the ContainerGroupsClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupsUpdate.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewContainerGroupsClient().Update(ctx, "demoResource", "demo1", armcontainerinstance.Resource{ Tags: map[string]*string{ "tag1key": to.Ptr("tag1Value"), "tag2key": to.Ptr("tag2Value"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ContainerGroup = armcontainerinstance.ContainerGroup{ // Properties: &armcontainerinstance.ContainerGroupPropertiesProperties{ // Containers: []*armcontainerinstance.Container{ // { // Name: to.Ptr("demo1"), // Properties: &armcontainerinstance.ContainerProperties{ // Command: []*string{ // }, // EnvironmentVariables: []*armcontainerinstance.EnvironmentVariable{ // }, // Image: to.Ptr("nginx"), // Ports: []*armcontainerinstance.ContainerPort{ // { // Port: to.Ptr[int32](80), // }}, // Resources: &armcontainerinstance.ResourceRequirements{ // Requests: &armcontainerinstance.ResourceRequests{ // CPU: to.Ptr[float64](1), // MemoryInGB: to.Ptr[float64](1.5), // }, // }, // VolumeMounts: []*armcontainerinstance.VolumeMount{ // { // Name: to.Ptr("volume1"), // MountPath: to.Ptr("/mnt/volume1"), // ReadOnly: to.Ptr(false), // }, // { // Name: to.Ptr("volume2"), // MountPath: to.Ptr("/mnt/volume2"), // ReadOnly: to.Ptr(false), // }, // { // Name: to.Ptr("volume3"), // MountPath: to.Ptr("/mnt/volume3"), // ReadOnly: to.Ptr(true), // }}, // }, // }}, // ImageRegistryCredentials: []*armcontainerinstance.ImageRegistryCredential{ // }, // IPAddress: &armcontainerinstance.IPAddress{ // Type: to.Ptr(armcontainerinstance.ContainerGroupIPAddressTypePublic), // DNSNameLabel: to.Ptr("dnsnamelabel1"), // Fqdn: to.Ptr("dnsnamelabel1.azure-container.io"), // IP: to.Ptr("10.0.0.1"), // Ports: []*armcontainerinstance.Port{ // { // Port: to.Ptr[int32](80), // Protocol: to.Ptr(armcontainerinstance.ContainerGroupNetworkProtocolTCP), // }}, // }, // OSType: to.Ptr(armcontainerinstance.OperatingSystemTypesLinux), // ProvisioningState: to.Ptr("Succeeded"), // Volumes: []*armcontainerinstance.Volume{ // { // Name: to.Ptr("volume1"), // AzureFile: &armcontainerinstance.AzureFileVolume{ // ShareName: to.Ptr("shareName"), // StorageAccountName: to.Ptr("accountName"), // }, // }, // { // Name: to.Ptr("volume2"), // EmptyDir: map[string]any{ // }, // }, // { // Name: to.Ptr("volume3"), // Secret: map[string]*string{ // }, // }}, // }, // Name: to.Ptr("demo1"), // Type: to.Ptr("Microsoft.ContainerInstance/containerGroups"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/demoResource/providers/Microsoft.ContainerInstance/containerGroups/demo1"), // Location: to.Ptr("WestUs"), // Tags: map[string]*string{ // "tag1key": to.Ptr("tag1Value"), // "tag2key": to.Ptr("tag2Value"), // }, // }
Output:
type ContainerGroupsClientBeginCreateOrUpdateOptions ¶
type ContainerGroupsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ContainerGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainerGroupsClient.BeginCreateOrUpdate method.
type ContainerGroupsClientBeginDeleteOptions ¶
type ContainerGroupsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ContainerGroupsClientBeginDeleteOptions contains the optional parameters for the ContainerGroupsClient.BeginDelete method.
type ContainerGroupsClientBeginRestartOptions ¶
type ContainerGroupsClientBeginRestartOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ContainerGroupsClientBeginRestartOptions contains the optional parameters for the ContainerGroupsClient.BeginRestart method.
type ContainerGroupsClientBeginStartOptions ¶
type ContainerGroupsClientBeginStartOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ContainerGroupsClientBeginStartOptions contains the optional parameters for the ContainerGroupsClient.BeginStart method.
type ContainerGroupsClientCreateOrUpdateResponse ¶
type ContainerGroupsClientCreateOrUpdateResponse struct { // A container group. ContainerGroup }
ContainerGroupsClientCreateOrUpdateResponse contains the response from method ContainerGroupsClient.BeginCreateOrUpdate.
type ContainerGroupsClientDeleteResponse ¶
type ContainerGroupsClientDeleteResponse struct { // A container group. ContainerGroup }
ContainerGroupsClientDeleteResponse contains the response from method ContainerGroupsClient.BeginDelete.
type ContainerGroupsClientGetOptions ¶
type ContainerGroupsClientGetOptions struct { }
ContainerGroupsClientGetOptions contains the optional parameters for the ContainerGroupsClient.Get method.
type ContainerGroupsClientGetOutboundNetworkDependenciesEndpointsOptions ¶
type ContainerGroupsClientGetOutboundNetworkDependenciesEndpointsOptions struct { }
ContainerGroupsClientGetOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the ContainerGroupsClient.GetOutboundNetworkDependenciesEndpoints method.
type ContainerGroupsClientGetOutboundNetworkDependenciesEndpointsResponse ¶
type ContainerGroupsClientGetOutboundNetworkDependenciesEndpointsResponse struct { // Response for network dependencies, always empty list. StringArray []*string }
ContainerGroupsClientGetOutboundNetworkDependenciesEndpointsResponse contains the response from method ContainerGroupsClient.GetOutboundNetworkDependenciesEndpoints.
type ContainerGroupsClientGetResponse ¶
type ContainerGroupsClientGetResponse struct { // A container group. ContainerGroup }
ContainerGroupsClientGetResponse contains the response from method ContainerGroupsClient.Get.
type ContainerGroupsClientListByResourceGroupOptions ¶
type ContainerGroupsClientListByResourceGroupOptions struct { }
ContainerGroupsClientListByResourceGroupOptions contains the optional parameters for the ContainerGroupsClient.NewListByResourceGroupPager method.
type ContainerGroupsClientListByResourceGroupResponse ¶
type ContainerGroupsClientListByResourceGroupResponse struct { // The container group list response that contains the container group properties. ContainerGroupListResult }
ContainerGroupsClientListByResourceGroupResponse contains the response from method ContainerGroupsClient.NewListByResourceGroupPager.
type ContainerGroupsClientListOptions ¶
type ContainerGroupsClientListOptions struct { }
ContainerGroupsClientListOptions contains the optional parameters for the ContainerGroupsClient.NewListPager method.
type ContainerGroupsClientListResponse ¶
type ContainerGroupsClientListResponse struct { // The container group list response that contains the container group properties. ContainerGroupListResult }
ContainerGroupsClientListResponse contains the response from method ContainerGroupsClient.NewListPager.
type ContainerGroupsClientRestartResponse ¶
type ContainerGroupsClientRestartResponse struct { }
ContainerGroupsClientRestartResponse contains the response from method ContainerGroupsClient.BeginRestart.
type ContainerGroupsClientStartResponse ¶
type ContainerGroupsClientStartResponse struct { }
ContainerGroupsClientStartResponse contains the response from method ContainerGroupsClient.BeginStart.
type ContainerGroupsClientStopOptions ¶
type ContainerGroupsClientStopOptions struct { }
ContainerGroupsClientStopOptions contains the optional parameters for the ContainerGroupsClient.Stop method.
type ContainerGroupsClientStopResponse ¶
type ContainerGroupsClientStopResponse struct { }
ContainerGroupsClientStopResponse contains the response from method ContainerGroupsClient.Stop.
type ContainerGroupsClientUpdateOptions ¶
type ContainerGroupsClientUpdateOptions struct { }
ContainerGroupsClientUpdateOptions contains the optional parameters for the ContainerGroupsClient.Update method.
type ContainerGroupsClientUpdateResponse ¶
type ContainerGroupsClientUpdateResponse struct { // A container group. ContainerGroup }
ContainerGroupsClientUpdateResponse contains the response from method ContainerGroupsClient.Update.
type ContainerHTTPGet ¶
type ContainerHTTPGet struct { // REQUIRED; The port number to probe. Port *int32 // The HTTP headers. HTTPHeaders []*HTTPHeader // The path to probe. Path *string // The scheme. Scheme *Scheme }
ContainerHTTPGet - The container Http Get settings, for liveness or readiness probe
func (ContainerHTTPGet) MarshalJSON ¶
func (c ContainerHTTPGet) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerHTTPGet.
func (*ContainerHTTPGet) UnmarshalJSON ¶
func (c *ContainerHTTPGet) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerHTTPGet.
type ContainerInstanceOperationsOrigin ¶
type ContainerInstanceOperationsOrigin string
ContainerInstanceOperationsOrigin - The intended executor of the operation.
const ( ContainerInstanceOperationsOriginSystem ContainerInstanceOperationsOrigin = "System" ContainerInstanceOperationsOriginUser ContainerInstanceOperationsOrigin = "User" )
func PossibleContainerInstanceOperationsOriginValues ¶
func PossibleContainerInstanceOperationsOriginValues() []ContainerInstanceOperationsOrigin
PossibleContainerInstanceOperationsOriginValues returns the possible values for the ContainerInstanceOperationsOrigin const type.
type ContainerNetworkProtocol ¶
type ContainerNetworkProtocol string
ContainerNetworkProtocol - The protocol associated with the port.
const ( ContainerNetworkProtocolTCP ContainerNetworkProtocol = "TCP" ContainerNetworkProtocolUDP ContainerNetworkProtocol = "UDP" )
func PossibleContainerNetworkProtocolValues ¶
func PossibleContainerNetworkProtocolValues() []ContainerNetworkProtocol
PossibleContainerNetworkProtocolValues returns the possible values for the ContainerNetworkProtocol const type.
type ContainerPort ¶
type ContainerPort struct { // REQUIRED; The port number exposed within the container group. Port *int32 // The protocol associated with the port. Protocol *ContainerNetworkProtocol }
ContainerPort - The port exposed on the container instance.
func (ContainerPort) MarshalJSON ¶
func (c ContainerPort) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerPort.
func (*ContainerPort) UnmarshalJSON ¶
func (c *ContainerPort) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerPort.
type ContainerProbe ¶
type ContainerProbe struct { // The execution command to probe Exec *ContainerExec // The failure threshold. FailureThreshold *int32 // The Http Get settings to probe HTTPGet *ContainerHTTPGet // The initial delay seconds. InitialDelaySeconds *int32 // The period seconds. PeriodSeconds *int32 // The success threshold. SuccessThreshold *int32 // The timeout seconds. TimeoutSeconds *int32 }
ContainerProbe - The container probe, for liveness or readiness
func (ContainerProbe) MarshalJSON ¶
func (c ContainerProbe) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerProbe.
func (*ContainerProbe) UnmarshalJSON ¶
func (c *ContainerProbe) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerProbe.
type ContainerProperties ¶
type ContainerProperties struct { // REQUIRED; The name of the image used to create the container instance. Image *string // REQUIRED; The resource requirements of the container instance. Resources *ResourceRequirements // The commands to execute within the container instance in exec form. Command []*string // The environment variables to set in the container instance. EnvironmentVariables []*EnvironmentVariable // The liveness probe. LivenessProbe *ContainerProbe // The exposed ports on the container instance. Ports []*ContainerPort // The readiness probe. ReadinessProbe *ContainerProbe // The container security properties. SecurityContext *SecurityContextDefinition // The volume mounts available to the container instance. VolumeMounts []*VolumeMount // READ-ONLY; The instance view of the container instance. Only valid in response. InstanceView *ContainerPropertiesInstanceView }
ContainerProperties - The container instance properties.
func (ContainerProperties) MarshalJSON ¶
func (c ContainerProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerProperties.
func (*ContainerProperties) UnmarshalJSON ¶
func (c *ContainerProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerProperties.
type ContainerPropertiesInstanceView ¶
type ContainerPropertiesInstanceView struct { // READ-ONLY; Current container instance state. CurrentState *ContainerState // READ-ONLY; The events of the container instance. Events []*Event // READ-ONLY; Previous container instance state. PreviousState *ContainerState // READ-ONLY; The number of times that the container instance has been restarted. RestartCount *int32 }
ContainerPropertiesInstanceView - The instance view of the container instance. Only valid in response.
func (ContainerPropertiesInstanceView) MarshalJSON ¶
func (c ContainerPropertiesInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerPropertiesInstanceView.
func (*ContainerPropertiesInstanceView) UnmarshalJSON ¶
func (c *ContainerPropertiesInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerPropertiesInstanceView.
type ContainerState ¶
type ContainerState struct { // READ-ONLY; The human-readable status of the container instance state. DetailStatus *string // READ-ONLY; The container instance exit codes correspond to those from the docker run command. ExitCode *int32 // READ-ONLY; The date-time when the container instance state finished. FinishTime *time.Time // READ-ONLY; The date-time when the container instance state started. StartTime *time.Time // READ-ONLY; The state of the container instance. State *string }
ContainerState - The container instance state.
func (ContainerState) MarshalJSON ¶
func (c ContainerState) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ContainerState.
func (*ContainerState) UnmarshalJSON ¶
func (c *ContainerState) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ContainerState.
type ContainersClient ¶
type ContainersClient struct {
// contains filtered or unexported fields
}
ContainersClient contains the methods for the Containers group. Don't use this type directly, use NewContainersClient() instead.
func NewContainersClient ¶
func NewContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContainersClient, error)
NewContainersClient creates a new instance of ContainersClient with the specified values.
- subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ContainersClient) Attach ¶
func (client *ContainersClient) Attach(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string, options *ContainersClientAttachOptions) (ContainersClientAttachResponse, error)
Attach - Attach to the output stream of a specific container instance in a specified resource group and container group. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-05-01
- resourceGroupName - The name of the resource group.
- containerGroupName - The name of the container group.
- containerName - The name of the container instance.
- options - ContainersClientAttachOptions contains the optional parameters for the ContainersClient.Attach method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerAttach.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewContainersClient().Attach(ctx, "demo", "demo1", "container1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ContainerAttachResponse = armcontainerinstance.ContainerAttachResponse{ // Password: to.Ptr("password"), // WebSocketURI: to.Ptr("wss://web-socket-uri"), // }
Output:
func (*ContainersClient) ExecuteCommand ¶
func (client *ContainersClient) ExecuteCommand(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string, containerExecRequest ContainerExecRequest, options *ContainersClientExecuteCommandOptions) (ContainersClientExecuteCommandResponse, error)
ExecuteCommand - Executes a command for a specific container instance in a specified resource group and container group. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-05-01
- resourceGroupName - The name of the resource group.
- containerGroupName - The name of the container group.
- containerName - The name of the container instance.
- containerExecRequest - The request for the exec command.
- options - ContainersClientExecuteCommandOptions contains the optional parameters for the ContainersClient.ExecuteCommand method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerExec.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewContainersClient().ExecuteCommand(ctx, "demo", "demo1", "container1", armcontainerinstance.ContainerExecRequest{ Command: to.Ptr("/bin/bash"), TerminalSize: &armcontainerinstance.ContainerExecRequestTerminalSize{ Cols: to.Ptr[int32](12), Rows: to.Ptr[int32](12), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.ContainerExecResponse = armcontainerinstance.ContainerExecResponse{ // Password: to.Ptr("password"), // WebSocketURI: to.Ptr("wss://web-socket-uri"), // }
Output:
func (*ContainersClient) ListLogs ¶
func (client *ContainersClient) ListLogs(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string, options *ContainersClientListLogsOptions) (ContainersClientListLogsResponse, error)
ListLogs - Get the logs for a specified container instance in a specified resource group and container group. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-05-01
- resourceGroupName - The name of the resource group.
- containerGroupName - The name of the container group.
- containerName - The name of the container instance.
- options - ContainersClientListLogsOptions contains the optional parameters for the ContainersClient.ListLogs method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerListLogs.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewContainersClient().ListLogs(ctx, "demo", "demo1", "container1", &armcontainerinstance.ContainersClientListLogsOptions{Tail: to.Ptr[int32](10), Timestamps: nil, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Logs = armcontainerinstance.Logs{ // Content: to.Ptr("log content"), // }
Output:
type ContainersClientAttachOptions ¶
type ContainersClientAttachOptions struct { }
ContainersClientAttachOptions contains the optional parameters for the ContainersClient.Attach method.
type ContainersClientAttachResponse ¶
type ContainersClientAttachResponse struct { // The information for the output stream from container attach. ContainerAttachResponse }
ContainersClientAttachResponse contains the response from method ContainersClient.Attach.
type ContainersClientExecuteCommandOptions ¶
type ContainersClientExecuteCommandOptions struct { }
ContainersClientExecuteCommandOptions contains the optional parameters for the ContainersClient.ExecuteCommand method.
type ContainersClientExecuteCommandResponse ¶
type ContainersClientExecuteCommandResponse struct { // The information for the container exec command. ContainerExecResponse }
ContainersClientExecuteCommandResponse contains the response from method ContainersClient.ExecuteCommand.
type ContainersClientListLogsOptions ¶
type ContainersClientListLogsOptions struct { // The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown // up to 4mb. Tail *int32 // If true, adds a timestamp at the beginning of every line of log output. If not provided, defaults to false. Timestamps *bool }
ContainersClientListLogsOptions contains the optional parameters for the ContainersClient.ListLogs method.
type ContainersClientListLogsResponse ¶
type ContainersClientListLogsResponse struct { // The logs. Logs }
ContainersClientListLogsResponse contains the response from method ContainersClient.ListLogs.
type DNSConfiguration ¶
type DNSConfiguration struct { // REQUIRED; The DNS servers for the container group. NameServers []*string // The DNS options for the container group. Options *string // The DNS search domains for hostname lookup in the container group. SearchDomains *string }
DNSConfiguration - DNS configuration for the container group.
func (DNSConfiguration) MarshalJSON ¶
func (d DNSConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DNSConfiguration.
func (*DNSConfiguration) UnmarshalJSON ¶
func (d *DNSConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DNSConfiguration.
type DNSNameLabelReusePolicy ¶
type DNSNameLabelReusePolicy string
DNSNameLabelReusePolicy - The value representing the security enum. The 'Unsecure' value is the default value if not selected and means the object's domain name label is not secured against subdomain takeover. The 'TenantReuse' value is the default value if selected and means the object's domain name label can be reused within the same tenant. The 'SubscriptionReuse' value means the object's domain name label can be reused within the same subscription. The 'ResourceGroupReuse' value means the object's domain name label can be reused within the same resource group. The 'NoReuse' value means the object's domain name label cannot be reused within the same resource group, subscription, or tenant.
const ( DNSNameLabelReusePolicyNoreuse DNSNameLabelReusePolicy = "Noreuse" DNSNameLabelReusePolicyResourceGroupReuse DNSNameLabelReusePolicy = "ResourceGroupReuse" DNSNameLabelReusePolicySubscriptionReuse DNSNameLabelReusePolicy = "SubscriptionReuse" DNSNameLabelReusePolicyTenantReuse DNSNameLabelReusePolicy = "TenantReuse" DNSNameLabelReusePolicyUnsecure DNSNameLabelReusePolicy = "Unsecure" )
func PossibleDNSNameLabelReusePolicyValues ¶
func PossibleDNSNameLabelReusePolicyValues() []DNSNameLabelReusePolicy
PossibleDNSNameLabelReusePolicyValues returns the possible values for the DNSNameLabelReusePolicy const type.
type DeploymentExtensionSpec ¶ added in v2.1.0
type DeploymentExtensionSpec struct { // REQUIRED; Name of the extension. Name *string // Extension specific properties Properties *DeploymentExtensionSpecProperties }
DeploymentExtensionSpec - Extension sidecars to be added to the deployment.
func (DeploymentExtensionSpec) MarshalJSON ¶ added in v2.1.0
func (d DeploymentExtensionSpec) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeploymentExtensionSpec.
func (*DeploymentExtensionSpec) UnmarshalJSON ¶ added in v2.1.0
func (d *DeploymentExtensionSpec) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentExtensionSpec.
type DeploymentExtensionSpecProperties ¶ added in v2.1.0
type DeploymentExtensionSpecProperties struct { // REQUIRED; Type of extension to be added. ExtensionType *string // REQUIRED; Version of the extension being used. Version *string // Protected settings for the extension. ProtectedSettings any // Settings for the extension. Settings any }
DeploymentExtensionSpecProperties - Extension specific properties
func (DeploymentExtensionSpecProperties) MarshalJSON ¶ added in v2.1.0
func (d DeploymentExtensionSpecProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeploymentExtensionSpecProperties.
func (*DeploymentExtensionSpecProperties) UnmarshalJSON ¶ added in v2.1.0
func (d *DeploymentExtensionSpecProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentExtensionSpecProperties.
type EncryptionProperties ¶
type EncryptionProperties struct { // REQUIRED; The encryption key name. KeyName *string // REQUIRED; The encryption key version. KeyVersion *string // REQUIRED; The keyvault base url. VaultBaseURL *string // The keyvault managed identity. Identity *string }
EncryptionProperties - The container group encryption properties.
func (EncryptionProperties) MarshalJSON ¶
func (e EncryptionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EncryptionProperties.
func (*EncryptionProperties) UnmarshalJSON ¶
func (e *EncryptionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionProperties.
type EnvironmentVariable ¶
type EnvironmentVariable struct { // REQUIRED; The name of the environment variable. Name *string // The value of the secure environment variable. SecureValue *string // The value of the environment variable. Value *string }
EnvironmentVariable - The environment variable to set within the container instance.
func (EnvironmentVariable) MarshalJSON ¶
func (e EnvironmentVariable) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EnvironmentVariable.
func (*EnvironmentVariable) UnmarshalJSON ¶
func (e *EnvironmentVariable) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentVariable.
type Event ¶
type Event struct { // READ-ONLY; The count of the event. Count *int32 // READ-ONLY; The date-time of the earliest logged event. FirstTimestamp *time.Time // READ-ONLY; The date-time of the latest logged event. LastTimestamp *time.Time // READ-ONLY; The event message. Message *string // READ-ONLY; The event name. Name *string // READ-ONLY; The event type. Type *string }
Event - A container group or container instance event.
func (Event) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Event.
func (*Event) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Event.
type GitRepoVolume ¶
type GitRepoVolume struct { // REQUIRED; Repository URL Repository *string // Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. // Otherwise, if specified, the volume will contain the git repository in // the subdirectory with the given name. Directory *string // Commit hash for the specified revision. Revision *string }
GitRepoVolume - Represents a volume that is populated with the contents of a git repository
func (GitRepoVolume) MarshalJSON ¶
func (g GitRepoVolume) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GitRepoVolume.
func (*GitRepoVolume) UnmarshalJSON ¶
func (g *GitRepoVolume) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GitRepoVolume.
type GpuResource ¶
type GpuResource struct { // REQUIRED; The count of the GPU resource. Count *int32 // REQUIRED; The SKU of the GPU resource. SKU *GpuSKU }
GpuResource - The GPU resource.
func (GpuResource) MarshalJSON ¶
func (g GpuResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GpuResource.
func (*GpuResource) UnmarshalJSON ¶
func (g *GpuResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GpuResource.
type GpuSKU ¶
type GpuSKU string
GpuSKU - The SKU of the GPU resource.
func PossibleGpuSKUValues ¶
func PossibleGpuSKUValues() []GpuSKU
PossibleGpuSKUValues returns the possible values for the GpuSKU const type.
type HTTPHeader ¶
HTTPHeader - The HTTP header.
func (HTTPHeader) MarshalJSON ¶
func (h HTTPHeader) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type HTTPHeader.
func (*HTTPHeader) UnmarshalJSON ¶
func (h *HTTPHeader) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type HTTPHeader.
type IPAddress ¶
type IPAddress struct { // REQUIRED; The list of ports exposed on the container group. Ports []*Port // REQUIRED; Specifies if the IP is exposed to the public internet or private VNET. Type *ContainerGroupIPAddressType // The value representing the security enum. The 'Unsecure' value is the default value if not selected and means the object's // domain name label is not secured against subdomain takeover. The // 'TenantReuse' value is the default value if selected and means the object's domain name label can be reused within the // same tenant. The 'SubscriptionReuse' value means the object's domain name label // can be reused within the same subscription. The 'ResourceGroupReuse' value means the object's domain name label can be // reused within the same resource group. The 'NoReuse' value means the object's // domain name label cannot be reused within the same resource group, subscription, or tenant. AutoGeneratedDomainNameLabelScope *DNSNameLabelReusePolicy // The Dns name label for the IP. DNSNameLabel *string // The IP exposed to the public internet. IP *string // READ-ONLY; The FQDN for the IP. Fqdn *string }
IPAddress - IP address for the container group.
func (IPAddress) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type IPAddress.
func (*IPAddress) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type IPAddress.
type ImageRegistryCredential ¶
type ImageRegistryCredential struct { // REQUIRED; The Docker image registry server without a protocol such as "http" and "https". Server *string // The identity for the private registry. Identity *string // The identity URL for the private registry. IdentityURL *string // The password for the private registry. Password *string // The username for the private registry. Username *string }
ImageRegistryCredential - Image registry credential.
func (ImageRegistryCredential) MarshalJSON ¶
func (i ImageRegistryCredential) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ImageRegistryCredential.
func (*ImageRegistryCredential) UnmarshalJSON ¶
func (i *ImageRegistryCredential) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ImageRegistryCredential.
type InitContainerDefinition ¶
type InitContainerDefinition struct { // REQUIRED; The name for the init container. Name *string // REQUIRED; The properties for the init container. Properties *InitContainerPropertiesDefinition }
InitContainerDefinition - The init container definition.
func (InitContainerDefinition) MarshalJSON ¶
func (i InitContainerDefinition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InitContainerDefinition.
func (*InitContainerDefinition) UnmarshalJSON ¶
func (i *InitContainerDefinition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InitContainerDefinition.
type InitContainerPropertiesDefinition ¶
type InitContainerPropertiesDefinition struct { // The command to execute within the init container in exec form. Command []*string // The environment variables to set in the init container. EnvironmentVariables []*EnvironmentVariable // The image of the init container. Image *string // The container security properties. SecurityContext *SecurityContextDefinition // The volume mounts available to the init container. VolumeMounts []*VolumeMount // READ-ONLY; The instance view of the init container. Only valid in response. InstanceView *InitContainerPropertiesDefinitionInstanceView }
InitContainerPropertiesDefinition - The init container definition properties.
func (InitContainerPropertiesDefinition) MarshalJSON ¶
func (i InitContainerPropertiesDefinition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InitContainerPropertiesDefinition.
func (*InitContainerPropertiesDefinition) UnmarshalJSON ¶
func (i *InitContainerPropertiesDefinition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InitContainerPropertiesDefinition.
type InitContainerPropertiesDefinitionInstanceView ¶
type InitContainerPropertiesDefinitionInstanceView struct { // READ-ONLY; The current state of the init container. CurrentState *ContainerState // READ-ONLY; The events of the init container. Events []*Event // READ-ONLY; The previous state of the init container. PreviousState *ContainerState // READ-ONLY; The number of times that the init container has been restarted. RestartCount *int32 }
InitContainerPropertiesDefinitionInstanceView - The instance view of the init container. Only valid in response.
func (InitContainerPropertiesDefinitionInstanceView) MarshalJSON ¶
func (i InitContainerPropertiesDefinitionInstanceView) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type InitContainerPropertiesDefinitionInstanceView.
func (*InitContainerPropertiesDefinitionInstanceView) UnmarshalJSON ¶
func (i *InitContainerPropertiesDefinitionInstanceView) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type InitContainerPropertiesDefinitionInstanceView.
type LocationClient ¶
type LocationClient struct {
// contains filtered or unexported fields
}
LocationClient contains the methods for the Location group. Don't use this type directly, use NewLocationClient() instead.
func NewLocationClient ¶
func NewLocationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocationClient, error)
NewLocationClient creates a new instance of LocationClient with the specified values.
- subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*LocationClient) NewListCachedImagesPager ¶
func (client *LocationClient) NewListCachedImagesPager(location string, options *LocationClientListCachedImagesOptions) *runtime.Pager[LocationClientListCachedImagesResponse]
NewListCachedImagesPager - Get the list of cached images on specific OS type for a subscription in a region.
Generated from API version 2023-05-01
- location - The identifier for the physical azure location.
- options - LocationClientListCachedImagesOptions contains the optional parameters for the LocationClient.NewListCachedImagesPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/CachedImagesList.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewLocationClient().NewListCachedImagesPager("westcentralus", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.CachedImagesListResult = armcontainerinstance.CachedImagesListResult{ // Value: []*armcontainerinstance.CachedImages{ // { // Image: to.Ptr("ubuntu:16.04"), // OSType: to.Ptr("Linux"), // }, // { // Image: to.Ptr("alpine:3.6"), // OSType: to.Ptr("Linux"), // }, // { // Image: to.Ptr("microsoft/nanoserver:10.0.14393.2485"), // OSType: to.Ptr("Windows"), // }}, // } }
Output:
func (*LocationClient) NewListCapabilitiesPager ¶
func (client *LocationClient) NewListCapabilitiesPager(location string, options *LocationClientListCapabilitiesOptions) *runtime.Pager[LocationClientListCapabilitiesResponse]
NewListCapabilitiesPager - Get the list of CPU/memory/GPU capabilities of a region.
Generated from API version 2023-05-01
- location - The identifier for the physical azure location.
- options - LocationClientListCapabilitiesOptions contains the optional parameters for the LocationClient.NewListCapabilitiesPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/CapabilitiesList.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewLocationClient().NewListCapabilitiesPager("westus", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.CapabilitiesListResult = armcontainerinstance.CapabilitiesListResult{ // Value: []*armcontainerinstance.Capabilities{ // { // Capabilities: &armcontainerinstance.CapabilitiesCapabilities{ // MaxCPU: to.Ptr[float32](4), // MaxGpuCount: to.Ptr[float32](4), // MaxMemoryInGB: to.Ptr[float32](14), // }, // Gpu: to.Ptr("K80"), // IPAddressType: to.Ptr("Public"), // Location: to.Ptr("West US"), // OSType: to.Ptr("Linux"), // ResourceType: to.Ptr("containerGroups"), // }, // { // Capabilities: &armcontainerinstance.CapabilitiesCapabilities{ // MaxCPU: to.Ptr[float32](4), // MaxGpuCount: to.Ptr[float32](0), // MaxMemoryInGB: to.Ptr[float32](14), // }, // Gpu: to.Ptr("None"), // IPAddressType: to.Ptr("Public"), // Location: to.Ptr("West US"), // OSType: to.Ptr("Windows"), // ResourceType: to.Ptr("containerGroups"), // }}, // } }
Output:
func (*LocationClient) NewListUsagePager ¶
func (client *LocationClient) NewListUsagePager(location string, options *LocationClientListUsageOptions) *runtime.Pager[LocationClientListUsageResponse]
NewListUsagePager - Get the usage for a subscription
Generated from API version 2023-05-01
- location - The identifier for the physical azure location.
- options - LocationClientListUsageOptions contains the optional parameters for the LocationClient.NewListUsagePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/ContainerGroupUsage.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewLocationClient().NewListUsagePager("westcentralus", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.UsageListResult = armcontainerinstance.UsageListResult{ // Value: []*armcontainerinstance.Usage{ // { // Name: &armcontainerinstance.UsageName{ // LocalizedValue: to.Ptr("Container Groups"), // Value: to.Ptr("ContainerGroups"), // }, // CurrentValue: to.Ptr[int32](1), // Limit: to.Ptr[int32](2000), // Unit: to.Ptr("Count"), // }}, // } }
Output:
type LocationClientListCachedImagesOptions ¶
type LocationClientListCachedImagesOptions struct { }
LocationClientListCachedImagesOptions contains the optional parameters for the LocationClient.NewListCachedImagesPager method.
type LocationClientListCachedImagesResponse ¶
type LocationClientListCachedImagesResponse struct { // The response containing cached images. CachedImagesListResult }
LocationClientListCachedImagesResponse contains the response from method LocationClient.NewListCachedImagesPager.
type LocationClientListCapabilitiesOptions ¶
type LocationClientListCapabilitiesOptions struct { }
LocationClientListCapabilitiesOptions contains the optional parameters for the LocationClient.NewListCapabilitiesPager method.
type LocationClientListCapabilitiesResponse ¶
type LocationClientListCapabilitiesResponse struct { // The response containing list of capabilities. CapabilitiesListResult }
LocationClientListCapabilitiesResponse contains the response from method LocationClient.NewListCapabilitiesPager.
type LocationClientListUsageOptions ¶
type LocationClientListUsageOptions struct { }
LocationClientListUsageOptions contains the optional parameters for the LocationClient.NewListUsagePager method.
type LocationClientListUsageResponse ¶
type LocationClientListUsageResponse struct { // The response containing the usage data UsageListResult }
LocationClientListUsageResponse contains the response from method LocationClient.NewListUsagePager.
type LogAnalytics ¶
type LogAnalytics struct { // REQUIRED; The workspace id for log analytics WorkspaceID *string // REQUIRED; The workspace key for log analytics WorkspaceKey *string // The log type to be used. LogType *LogAnalyticsLogType // Metadata for log analytics. Metadata map[string]*string // The workspace resource id for log analytics WorkspaceResourceID *string }
LogAnalytics - Container group log analytics information.
func (LogAnalytics) MarshalJSON ¶
func (l LogAnalytics) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LogAnalytics.
func (*LogAnalytics) UnmarshalJSON ¶
func (l *LogAnalytics) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalytics.
type LogAnalyticsLogType ¶
type LogAnalyticsLogType string
LogAnalyticsLogType - The log type to be used.
const ( LogAnalyticsLogTypeContainerInsights LogAnalyticsLogType = "ContainerInsights" LogAnalyticsLogTypeContainerInstanceLogs LogAnalyticsLogType = "ContainerInstanceLogs" )
func PossibleLogAnalyticsLogTypeValues ¶
func PossibleLogAnalyticsLogTypeValues() []LogAnalyticsLogType
PossibleLogAnalyticsLogTypeValues returns the possible values for the LogAnalyticsLogType const type.
type Logs ¶
type Logs struct { // The content of the log. Content *string }
Logs - The logs.
func (Logs) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Logs.
func (*Logs) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Logs.
type OperatingSystemTypes ¶
type OperatingSystemTypes string
OperatingSystemTypes - The operating system type required by the containers in the container group.
const ( OperatingSystemTypesLinux OperatingSystemTypes = "Linux" OperatingSystemTypesWindows OperatingSystemTypes = "Windows" )
func PossibleOperatingSystemTypesValues ¶
func PossibleOperatingSystemTypesValues() []OperatingSystemTypes
PossibleOperatingSystemTypesValues returns the possible values for the OperatingSystemTypes const type.
type Operation ¶
type Operation struct { // REQUIRED; The display information of the operation. Display *OperationDisplay // REQUIRED; The name of the operation. Name *string // The intended executor of the operation. Origin *ContainerInstanceOperationsOrigin // The additional properties. Properties any }
Operation - An operation for Azure Container Instance service.
func (Operation) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Operation.
func (*Operation) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Operation.
type OperationDisplay ¶
type OperationDisplay struct { // The description of the operation. Description *string // The friendly name of the operation. Operation *string // The name of the provider of the operation. Provider *string // The name of the resource type of the operation. Resource *string }
OperationDisplay - The display information of the operation.
func (OperationDisplay) MarshalJSON ¶
func (o OperationDisplay) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationDisplay.
func (*OperationDisplay) UnmarshalJSON ¶
func (o *OperationDisplay) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.
type OperationListResult ¶
type OperationListResult struct { // The URI to fetch the next page of operations. NextLink *string // The list of operations. Value []*Operation }
OperationListResult - The operation list response that contains all operations for Azure Container Instance service.
func (OperationListResult) MarshalJSON ¶
func (o OperationListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationListResult.
func (*OperationListResult) UnmarshalJSON ¶
func (o *OperationListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.
type OperationsClient ¶
type OperationsClient struct {
// contains filtered or unexported fields
}
OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.
func NewOperationsClient ¶
func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)
NewOperationsClient creates a new instance of OperationsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*OperationsClient) NewListPager ¶
func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]
NewListPager - List the operations for Azure Container Instance service.
Generated from API version 2023-05-01
- options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/OperationsList.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewOperationsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.OperationListResult = armcontainerinstance.OperationListResult{ // Value: []*armcontainerinstance.Operation{ // { // Name: to.Ptr("Microsoft.ContainerInstance/containerGroups/read"), // Display: &armcontainerinstance.OperationDisplay{ // Description: to.Ptr("Get all container goups."), // Operation: to.Ptr("Get Container Groups"), // Provider: to.Ptr("Microsoft Container Instance"), // Resource: to.Ptr("Container Group"), // }, // Origin: to.Ptr(armcontainerinstance.ContainerInstanceOperationsOriginUser), // }}, // } }
Output:
type OperationsClientListOptions ¶
type OperationsClientListOptions struct { }
OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
type OperationsClientListResponse ¶
type OperationsClientListResponse struct { // The operation list response that contains all operations for Azure Container Instance service. OperationListResult }
OperationsClientListResponse contains the response from method OperationsClient.NewListPager.
type Port ¶
type Port struct { // REQUIRED; The port number. Port *int32 // The protocol associated with the port. Protocol *ContainerGroupNetworkProtocol }
Port - The port exposed on the container group.
func (Port) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Port.
func (*Port) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Port.
type Resource ¶
type Resource struct { // The resource location. Location *string // The resource tags. Tags map[string]*string // The zones for the container group. Zones []*string // READ-ONLY; The resource id. ID *string // READ-ONLY; The resource name. Name *string // READ-ONLY; The resource type. Type *string }
Resource - The Resource model definition.
func (Resource) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Resource.
func (*Resource) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Resource.
type ResourceIdentityType ¶
type ResourceIdentityType string
ResourceIdentityType - The type of identity used for the container group. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the container group.
const ( ResourceIdentityTypeNone ResourceIdentityType = "None" ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" )
func PossibleResourceIdentityTypeValues ¶
func PossibleResourceIdentityTypeValues() []ResourceIdentityType
PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type.
type ResourceLimits ¶
type ResourceLimits struct { // The CPU limit of this container instance. CPU *float64 // The GPU limit of this container instance. Gpu *GpuResource // The memory limit in GB of this container instance. MemoryInGB *float64 }
ResourceLimits - The resource limits.
func (ResourceLimits) MarshalJSON ¶
func (r ResourceLimits) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceLimits.
func (*ResourceLimits) UnmarshalJSON ¶
func (r *ResourceLimits) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceLimits.
type ResourceRequests ¶
type ResourceRequests struct { // REQUIRED; The CPU request of this container instance. CPU *float64 // REQUIRED; The memory request in GB of this container instance. MemoryInGB *float64 // The GPU request of this container instance. Gpu *GpuResource }
ResourceRequests - The resource requests.
func (ResourceRequests) MarshalJSON ¶
func (r ResourceRequests) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceRequests.
func (*ResourceRequests) UnmarshalJSON ¶
func (r *ResourceRequests) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceRequests.
type ResourceRequirements ¶
type ResourceRequirements struct { // REQUIRED; The resource requests of this container instance. Requests *ResourceRequests // The resource limits of this container instance. Limits *ResourceLimits }
ResourceRequirements - The resource requirements.
func (ResourceRequirements) MarshalJSON ¶
func (r ResourceRequirements) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceRequirements.
func (*ResourceRequirements) UnmarshalJSON ¶
func (r *ResourceRequirements) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceRequirements.
type Scheme ¶
type Scheme string
Scheme - The scheme.
func PossibleSchemeValues ¶
func PossibleSchemeValues() []Scheme
PossibleSchemeValues returns the possible values for the Scheme const type.
type SecurityContextCapabilitiesDefinition ¶ added in v2.3.0
type SecurityContextCapabilitiesDefinition struct { // The capabilities to add to the container. Add []*string // The capabilities to drop from the container. Drop []*string }
SecurityContextCapabilitiesDefinition - The capabilities to add or drop from a container.
func (SecurityContextCapabilitiesDefinition) MarshalJSON ¶ added in v2.3.0
func (s SecurityContextCapabilitiesDefinition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SecurityContextCapabilitiesDefinition.
func (*SecurityContextCapabilitiesDefinition) UnmarshalJSON ¶ added in v2.3.0
func (s *SecurityContextCapabilitiesDefinition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SecurityContextCapabilitiesDefinition.
type SecurityContextDefinition ¶ added in v2.3.0
type SecurityContextDefinition struct { // A boolean value indicating whether the init process can elevate its privileges AllowPrivilegeEscalation *bool // The capabilities to add or drop from a container. Capabilities *SecurityContextCapabilitiesDefinition // The flag to determine if the container permissions is elevated to Privileged. Privileged *bool // Sets the User GID for the container. RunAsGroup *int32 // Sets the User UID for the container. RunAsUser *int32 // a base64 encoded string containing the contents of the JSON in the seccomp profile SeccompProfile *string }
SecurityContextDefinition - The security context for the container.
func (SecurityContextDefinition) MarshalJSON ¶ added in v2.3.0
func (s SecurityContextDefinition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SecurityContextDefinition.
func (*SecurityContextDefinition) UnmarshalJSON ¶ added in v2.3.0
func (s *SecurityContextDefinition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SecurityContextDefinition.
type SubnetServiceAssociationLinkClient ¶
type SubnetServiceAssociationLinkClient struct {
// contains filtered or unexported fields
}
SubnetServiceAssociationLinkClient contains the methods for the SubnetServiceAssociationLink group. Don't use this type directly, use NewSubnetServiceAssociationLinkClient() instead.
func NewSubnetServiceAssociationLinkClient ¶
func NewSubnetServiceAssociationLinkClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubnetServiceAssociationLinkClient, error)
NewSubnetServiceAssociationLinkClient creates a new instance of SubnetServiceAssociationLinkClient with the specified values.
- subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*SubnetServiceAssociationLinkClient) BeginDelete ¶
func (client *SubnetServiceAssociationLinkClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *SubnetServiceAssociationLinkClientBeginDeleteOptions) (*runtime.Poller[SubnetServiceAssociationLinkClientDeleteResponse], error)
BeginDelete - Delete container group virtual network association links. The operation does not delete other resources provided by the user. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-05-01
- resourceGroupName - The name of the resource group.
- virtualNetworkName - The name of the virtual network.
- subnetName - The name of the subnet.
- options - SubnetServiceAssociationLinkClientBeginDeleteOptions contains the optional parameters for the SubnetServiceAssociationLinkClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e60df62e9e0d88462e6abba81a76d94eab000f0d/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2023-05-01/examples/SubnetServiceAssociationLinkDelete.json
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armcontainerinstance.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewSubnetServiceAssociationLinkClient().BeginDelete(ctx, "demo", "demo2", "demo3", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) }
Output:
type SubnetServiceAssociationLinkClientBeginDeleteOptions ¶
type SubnetServiceAssociationLinkClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
SubnetServiceAssociationLinkClientBeginDeleteOptions contains the optional parameters for the SubnetServiceAssociationLinkClient.BeginDelete method.
type SubnetServiceAssociationLinkClientDeleteResponse ¶
type SubnetServiceAssociationLinkClientDeleteResponse struct { }
SubnetServiceAssociationLinkClientDeleteResponse contains the response from method SubnetServiceAssociationLinkClient.BeginDelete.
type Usage ¶
type Usage struct { // READ-ONLY; The current usage of the resource CurrentValue *int32 // READ-ONLY; Id of the usage result ID *string // READ-ONLY; The maximum permitted usage of the resource. Limit *int32 // READ-ONLY; The name object of the resource Name *UsageName // READ-ONLY; Unit of the usage result Unit *string }
Usage - A single usage result
func (Usage) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Usage.
func (*Usage) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Usage.
type UsageListResult ¶
type UsageListResult struct { // READ-ONLY; The usage data. Value []*Usage }
UsageListResult - The response containing the usage data
func (UsageListResult) MarshalJSON ¶
func (u UsageListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UsageListResult.
func (*UsageListResult) UnmarshalJSON ¶
func (u *UsageListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UsageListResult.
type UsageName ¶
type UsageName struct { // READ-ONLY; The localized name of the resource LocalizedValue *string // READ-ONLY; The name of the resource Value *string }
UsageName - The name object of the resource
func (UsageName) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type UsageName.
func (*UsageName) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type UsageName.
type UserAssignedIdentities ¶
type UserAssignedIdentities struct { // READ-ONLY; The client id of user assigned identity. ClientID *string // READ-ONLY; The principal id of user assigned identity. PrincipalID *string }
UserAssignedIdentities - The list of user identities associated with the container group. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
func (UserAssignedIdentities) MarshalJSON ¶
func (u UserAssignedIdentities) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentities.
func (*UserAssignedIdentities) UnmarshalJSON ¶
func (u *UserAssignedIdentities) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentities.
type Volume ¶
type Volume struct { // REQUIRED; The name of the volume. Name *string // The Azure File volume. AzureFile *AzureFileVolume // The empty directory volume. EmptyDir any // The git repo volume. GitRepo *GitRepoVolume // The secret volume. Secret map[string]*string }
Volume - The properties of the volume.
func (Volume) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Volume.
func (*Volume) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Volume.
type VolumeMount ¶
type VolumeMount struct { // REQUIRED; The path within the container where the volume should be mounted. Must not contain colon (:). MountPath *string // REQUIRED; The name of the volume mount. Name *string // The flag indicating whether the volume mount is read-only. ReadOnly *bool }
VolumeMount - The properties of the volume mount.
func (VolumeMount) MarshalJSON ¶
func (v VolumeMount) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VolumeMount.
func (*VolumeMount) UnmarshalJSON ¶
func (v *VolumeMount) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VolumeMount.