armcontainerinstance

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2022 License: MIT Imports: 17 Imported by: 3

README

Azure Container Instance Module for Go

PkgGoDev

The armcontainerinstance module provides operations for working with Azure Container Instance.

Source code

Getting started

Prerequisites

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Container Instance module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Container Instance. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Clients

Azure Container Instance modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential.

client, err := armcontainerinstance.NewContainersClient(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
client, err := armcontainerinstance.NewContainersClient(<subscription ID>, cred, &options)

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Container Instance label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoGeneratedDomainNameLabelScope added in v0.3.0

type AutoGeneratedDomainNameLabelScope string

AutoGeneratedDomainNameLabelScope - The value representing the security enum.

const (
	AutoGeneratedDomainNameLabelScopeNoreuse            AutoGeneratedDomainNameLabelScope = "Noreuse"
	AutoGeneratedDomainNameLabelScopeResourceGroupReuse AutoGeneratedDomainNameLabelScope = "ResourceGroupReuse"
	AutoGeneratedDomainNameLabelScopeSubscriptionReuse  AutoGeneratedDomainNameLabelScope = "SubscriptionReuse"
	AutoGeneratedDomainNameLabelScopeTenantReuse        AutoGeneratedDomainNameLabelScope = "TenantReuse"
	AutoGeneratedDomainNameLabelScopeUnsecure           AutoGeneratedDomainNameLabelScope = "Unsecure"
)

func PossibleAutoGeneratedDomainNameLabelScopeValues added in v0.3.0

func PossibleAutoGeneratedDomainNameLabelScopeValues() []AutoGeneratedDomainNameLabelScope

PossibleAutoGeneratedDomainNameLabelScopeValues returns the possible values for the AutoGeneratedDomainNameLabelScope const type.

type AzureFileVolume

type AzureFileVolume struct {
	// REQUIRED; The name of the Azure File share to be mounted as a volume.
	ShareName *string `json:"shareName,omitempty"`

	// REQUIRED; The name of the storage account that contains the Azure File share.
	StorageAccountName *string `json:"storageAccountName,omitempty"`

	// The flag indicating whether the Azure File shared mounted as a volume is read-only.
	ReadOnly *bool `json:"readOnly,omitempty"`

	// The storage account access key used to access the Azure File share.
	StorageAccountKey *string `json:"storageAccountKey,omitempty"`
}

AzureFileVolume - The properties of the Azure File volume. Azure File shares are mounted as volumes.

type CachedImages

type CachedImages struct {
	// REQUIRED; The cached image name.
	Image *string `json:"image,omitempty"`

	// REQUIRED; The OS type of the cached image.
	OSType *string `json:"osType,omitempty"`
}

CachedImages - The cached image and OS type.

type CachedImagesListResult

type CachedImagesListResult struct {
	// The URI to fetch the next page of cached images.
	NextLink *string `json:"nextLink,omitempty"`

	// The list of cached images.
	Value []*CachedImages `json:"value,omitempty"`
}

CachedImagesListResult - The response containing cached images.

type Capabilities

type Capabilities struct {
	// READ-ONLY; The supported capabilities.
	Capabilities *CapabilitiesCapabilities `json:"capabilities,omitempty" azure:"ro"`

	// READ-ONLY; The GPU sku that this capability describes.
	Gpu *string `json:"gpu,omitempty" azure:"ro"`

	// READ-ONLY; The ip address type that this capability describes.
	IPAddressType *string `json:"ipAddressType,omitempty" azure:"ro"`

	// READ-ONLY; The resource location.
	Location *string `json:"location,omitempty" azure:"ro"`

	// READ-ONLY; The OS type that this capability describes.
	OSType *string `json:"osType,omitempty" azure:"ro"`

	// READ-ONLY; The resource type that this capability describes.
	ResourceType *string `json:"resourceType,omitempty" azure:"ro"`
}

Capabilities - The regional capabilities.

type CapabilitiesCapabilities

type CapabilitiesCapabilities struct {
	// READ-ONLY; The maximum allowed CPU request in cores.
	MaxCPU *float32 `json:"maxCpu,omitempty" azure:"ro"`

	// READ-ONLY; The maximum allowed GPU count.
	MaxGpuCount *float32 `json:"maxGpuCount,omitempty" azure:"ro"`

	// READ-ONLY; The maximum allowed memory request in GB.
	MaxMemoryInGB *float32 `json:"maxMemoryInGB,omitempty" azure:"ro"`
}

CapabilitiesCapabilities - The supported capabilities.

type CapabilitiesListResult

type CapabilitiesListResult struct {
	// The URI to fetch the next page of capabilities.
	NextLink *string `json:"nextLink,omitempty"`

	// The list of capabilities.
	Value []*Capabilities `json:"value,omitempty"`
}

CapabilitiesListResult - The response containing list of capabilities.

type CloudError

type CloudError struct {
	// An error response from the Container Instance service.
	Error *CloudErrorBody `json:"error,omitempty"`
}

CloudError - An error response from the Container Instance service.

type CloudErrorBody

type CloudErrorBody struct {
	// An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
	Code *string `json:"code,omitempty"`

	// A list of additional details about the error.
	Details []*CloudErrorBody `json:"details,omitempty"`

	// A message describing the error, intended to be suitable for display in a user interface.
	Message *string `json:"message,omitempty"`

	// The target of the particular error. For example, the name of the property in error.
	Target *string `json:"target,omitempty"`
}

CloudErrorBody - An error response from the Container Instance service.

type Components10Wh5UdSchemasContainergroupidentityPropertiesUserassignedidentitiesAdditionalproperties

type Components10Wh5UdSchemasContainergroupidentityPropertiesUserassignedidentitiesAdditionalproperties struct {
	// READ-ONLY; The client id of user assigned identity.
	ClientID *string `json:"clientId,omitempty" azure:"ro"`

	// READ-ONLY; The principal id of user assigned identity.
	PrincipalID *string `json:"principalId,omitempty" azure:"ro"`
}

type Container

type Container struct {
	// REQUIRED; The user-provided name of the container instance.
	Name *string `json:"name,omitempty"`

	// REQUIRED; The properties of the container instance.
	Properties *ContainerProperties `json:"properties,omitempty"`
}

Container - A container instance.

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 `json:"password,omitempty"`

	// The uri for the output stream from the attach.
	WebSocketURI *string `json:"webSocketUri,omitempty"`
}

ContainerAttachResponse - The information for the output stream from container attach.

type ContainerExec

type ContainerExec struct {
	// The commands to execute within the container.
	Command []*string `json:"command,omitempty"`
}

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.

type ContainerExecRequest

type ContainerExecRequest struct {
	// The command to be executed.
	Command *string `json:"command,omitempty"`

	// The size of the terminal.
	TerminalSize *ContainerExecRequestTerminalSize `json:"terminalSize,omitempty"`
}

ContainerExecRequest - The container exec request.

type ContainerExecRequestTerminalSize

type ContainerExecRequestTerminalSize struct {
	// The column size of the terminal
	Cols *int32 `json:"cols,omitempty"`

	// The row size of the terminal
	Rows *int32 `json:"rows,omitempty"`
}

ContainerExecRequestTerminalSize - The size of the terminal.

type ContainerExecResponse

type ContainerExecResponse struct {
	// The password to start the exec command.
	Password *string `json:"password,omitempty"`

	// The uri for the exec websocket.
	WebSocketURI *string `json:"webSocketUri,omitempty"`
}

ContainerExecResponse - The information for the container exec command.

type ContainerGroup

type ContainerGroup struct {
	// REQUIRED; The container group properties
	Properties *ContainerGroupProperties `json:"properties,omitempty"`

	// The identity of the container group, if configured.
	Identity *ContainerGroupIdentity `json:"identity,omitempty"`

	// The resource location.
	Location *string `json:"location,omitempty"`

	// The resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// The zones for the container group.
	Zones []*string `json:"zones,omitempty"`

	// READ-ONLY; The resource id.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ContainerGroup - A container group.

func (ContainerGroup) MarshalJSON

func (c ContainerGroup) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ContainerGroup.

type ContainerGroupDiagnostics

type ContainerGroupDiagnostics struct {
	// Container group log analytics information.
	LogAnalytics *LogAnalytics `json:"logAnalytics,omitempty"`
}

ContainerGroupDiagnostics - Container group diagnostic information.

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 `json:"type,omitempty"`

	// 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}'.
	UserAssignedIdentities map[string]*Components10Wh5UdSchemasContainergroupidentityPropertiesUserassignedidentitiesAdditionalproperties `json:"userAssignedIdentities,omitempty"`

	// READ-ONLY; The principal id of the container group identity. This property will only be provided for a system assigned
	// identity.
	PrincipalID *string `json:"principalId,omitempty" azure:"ro"`

	// READ-ONLY; The tenant id associated with the container group. This property will only be provided for a system assigned
	// identity.
	TenantID *string `json:"tenantId,omitempty" azure:"ro"`
}

ContainerGroupIdentity - Identity for the container group.

func (ContainerGroupIdentity) MarshalJSON

func (c ContainerGroupIdentity) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ContainerGroupIdentity.

type ContainerGroupListResult

type ContainerGroupListResult struct {
	// The URI to fetch the next page of container groups.
	NextLink *string `json:"nextLink,omitempty"`

	// The list of container groups.
	Value []*ContainerGroup `json:"value,omitempty"`
}

ContainerGroupListResult - The container group list response that contains the container group properties.

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 ContainerGroupProperties

type ContainerGroupProperties struct {
	// REQUIRED; The containers within the container group.
	Containers []*Container `json:"containers,omitempty"`

	// REQUIRED; The operating system type required by the containers in the container group.
	OSType *OperatingSystemTypes `json:"osType,omitempty"`

	// The DNS config information for a container group.
	DNSConfig *DNSConfiguration `json:"dnsConfig,omitempty"`

	// The diagnostic information for a container group.
	Diagnostics *ContainerGroupDiagnostics `json:"diagnostics,omitempty"`

	// The encryption properties for a container group.
	EncryptionProperties *EncryptionProperties `json:"encryptionProperties,omitempty"`

	// The IP address type of the container group.
	IPAddress *IPAddress `json:"ipAddress,omitempty"`

	// The image registry credentials by which the container group is created from.
	ImageRegistryCredentials []*ImageRegistryCredential `json:"imageRegistryCredentials,omitempty"`

	// The init containers for a container group.
	InitContainers []*InitContainerDefinition `json:"initContainers,omitempty"`

	// Restart policy for all containers within the container group.
	// * Always Always restart
	// * OnFailure Restart on failure
	// * Never Never restart
	RestartPolicy *ContainerGroupRestartPolicy `json:"restartPolicy,omitempty"`

	// The SKU for a container group.
	SKU *ContainerGroupSKU `json:"sku,omitempty"`

	// The subnet resource IDs for a container group.
	SubnetIDs []*ContainerGroupSubnetID `json:"subnetIds,omitempty"`

	// The list of volumes that can be mounted by containers in this container group.
	Volumes []*Volume `json:"volumes,omitempty"`

	// READ-ONLY; The instance view of the container group. Only valid in response.
	InstanceView *ContainerGroupPropertiesInstanceView `json:"instanceView,omitempty" azure:"ro"`

	// READ-ONLY; The provisioning state of the container group. This only appears in the response.
	ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"`
}

ContainerGroupProperties - The container group properties

func (ContainerGroupProperties) MarshalJSON

func (c ContainerGroupProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ContainerGroupProperties.

type ContainerGroupPropertiesInstanceView

type ContainerGroupPropertiesInstanceView struct {
	// READ-ONLY; The events of this container group.
	Events []*Event `json:"events,omitempty" azure:"ro"`

	// READ-ONLY; The state of the container group. Only valid in response.
	State *string `json:"state,omitempty" azure:"ro"`
}

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.

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 (
	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 `json:"id,omitempty"`

	// Friendly name for the subnet.
	Name *string `json:"name,omitempty"`
}

ContainerGroupSubnetID - Container group subnet information.

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 2021-10-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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupsCreateOrUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcontainerinstance.NewContainerGroupsClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginCreateOrUpdate(ctx,
		"demo",
		"demo1",
		armcontainerinstance.ContainerGroup{
			Location: to.Ptr("west us"),
			Identity: &armcontainerinstance.ContainerGroupIdentity{
				Type: to.Ptr(armcontainerinstance.ResourceIdentityTypeSystemAssignedUserAssigned),
				UserAssignedIdentities: map[string]*armcontainerinstance.Components10Wh5UdSchemasContainergroupidentityPropertiesUserassignedidentitiesAdditionalproperties{
					"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-name": {},
				},
			},
			Properties: &armcontainerinstance.ContainerGroupProperties{
				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),
					DNSNameLabel:            to.Ptr("dnsnamelabel1"),
					DNSNameLabelReusePolicy: to.Ptr(armcontainerinstance.AutoGeneratedDomainNameLabelScopeUnsecure),
					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]interface{}{},
					},
					{
						Name: to.Ptr("volume3"),
						Secret: map[string]*string{
							"secretKey1": to.Ptr("SecretValue1InBase64"),
							"secretKey2": to.Ptr("SecretValue2InBase64"),
						},
					}},
			},
		},
		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)
	}
	// TODO: use response item
	_ = res
}
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 2021-10-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/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupsDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcontainerinstance.NewContainerGroupsClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.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)
	}
	// TODO: use response item
	_ = res
}
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 2021-10-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/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupsRestart.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcontainerinstance.NewContainerGroupsClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.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 2021-10-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/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupsStart.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcontainerinstance.NewContainerGroupsClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.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 2021-10-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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupsGet_Failed.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcontainerinstance.NewContainerGroupsClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx,
		"demo",
		"demo1",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*ContainerGroupsClient) GetOutboundNetworkDependenciesEndpoints

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 2021-10-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 added in v0.4.0

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. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-10-01 resourceGroupName - The name of the resource group. options - ContainerGroupsClientListByResourceGroupOptions contains the optional parameters for the ContainerGroupsClient.ListByResourceGroup method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupsListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcontainerinstance.NewContainerGroupsClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListByResourceGroupPager("demo",
		nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*ContainerGroupsClient) NewListPager added in v0.4.0

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. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-10-01 options - ContainerGroupsClientListOptions contains the optional parameters for the ContainerGroupsClient.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcontainerinstance.NewContainerGroupsClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListPager(nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
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 2021-10-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/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupsStop.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcontainerinstance.NewContainerGroupsClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = client.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 2021-10-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/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupsUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcontainerinstance.NewContainerGroupsClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.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)
	}
	// TODO: use response item
	_ = res
}
Output:

type ContainerGroupsClientBeginCreateOrUpdateOptions added in v0.2.0

type ContainerGroupsClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ContainerGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainerGroupsClient.BeginCreateOrUpdate method.

type ContainerGroupsClientBeginDeleteOptions added in v0.2.0

type ContainerGroupsClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ContainerGroupsClientBeginDeleteOptions contains the optional parameters for the ContainerGroupsClient.BeginDelete method.

type ContainerGroupsClientBeginRestartOptions added in v0.2.0

type ContainerGroupsClientBeginRestartOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ContainerGroupsClientBeginRestartOptions contains the optional parameters for the ContainerGroupsClient.BeginRestart method.

type ContainerGroupsClientBeginStartOptions added in v0.2.0

type ContainerGroupsClientBeginStartOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ContainerGroupsClientBeginStartOptions contains the optional parameters for the ContainerGroupsClient.BeginStart method.

type ContainerGroupsClientCreateOrUpdateResponse added in v0.2.0

type ContainerGroupsClientCreateOrUpdateResponse struct {
	ContainerGroup
}

ContainerGroupsClientCreateOrUpdateResponse contains the response from method ContainerGroupsClient.CreateOrUpdate.

type ContainerGroupsClientDeleteResponse added in v0.2.0

type ContainerGroupsClientDeleteResponse struct {
	ContainerGroup
}

ContainerGroupsClientDeleteResponse contains the response from method ContainerGroupsClient.Delete.

type ContainerGroupsClientGetOptions added in v0.2.0

type ContainerGroupsClientGetOptions struct {
}

ContainerGroupsClientGetOptions contains the optional parameters for the ContainerGroupsClient.Get method.

type ContainerGroupsClientGetOutboundNetworkDependenciesEndpointsOptions added in v0.2.0

type ContainerGroupsClientGetOutboundNetworkDependenciesEndpointsOptions struct {
}

ContainerGroupsClientGetOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the ContainerGroupsClient.GetOutboundNetworkDependenciesEndpoints method.

type ContainerGroupsClientGetOutboundNetworkDependenciesEndpointsResponse added in v0.2.0

type ContainerGroupsClientGetOutboundNetworkDependenciesEndpointsResponse struct {
	// Response for network dependencies, always empty list.
	StringArray []*string
}

ContainerGroupsClientGetOutboundNetworkDependenciesEndpointsResponse contains the response from method ContainerGroupsClient.GetOutboundNetworkDependenciesEndpoints.

type ContainerGroupsClientGetResponse added in v0.2.0

type ContainerGroupsClientGetResponse struct {
	ContainerGroup
}

ContainerGroupsClientGetResponse contains the response from method ContainerGroupsClient.Get.

type ContainerGroupsClientListByResourceGroupOptions added in v0.2.0

type ContainerGroupsClientListByResourceGroupOptions struct {
}

ContainerGroupsClientListByResourceGroupOptions contains the optional parameters for the ContainerGroupsClient.ListByResourceGroup method.

type ContainerGroupsClientListByResourceGroupResponse added in v0.2.0

type ContainerGroupsClientListByResourceGroupResponse struct {
	ContainerGroupListResult
}

ContainerGroupsClientListByResourceGroupResponse contains the response from method ContainerGroupsClient.ListByResourceGroup.

type ContainerGroupsClientListOptions added in v0.2.0

type ContainerGroupsClientListOptions struct {
}

ContainerGroupsClientListOptions contains the optional parameters for the ContainerGroupsClient.List method.

type ContainerGroupsClientListResponse added in v0.2.0

type ContainerGroupsClientListResponse struct {
	ContainerGroupListResult
}

ContainerGroupsClientListResponse contains the response from method ContainerGroupsClient.List.

type ContainerGroupsClientRestartResponse added in v0.2.0

type ContainerGroupsClientRestartResponse struct {
}

ContainerGroupsClientRestartResponse contains the response from method ContainerGroupsClient.Restart.

type ContainerGroupsClientStartResponse added in v0.2.0

type ContainerGroupsClientStartResponse struct {
}

ContainerGroupsClientStartResponse contains the response from method ContainerGroupsClient.Start.

type ContainerGroupsClientStopOptions added in v0.2.0

type ContainerGroupsClientStopOptions struct {
}

ContainerGroupsClientStopOptions contains the optional parameters for the ContainerGroupsClient.Stop method.

type ContainerGroupsClientStopResponse added in v0.2.0

type ContainerGroupsClientStopResponse struct {
}

ContainerGroupsClientStopResponse contains the response from method ContainerGroupsClient.Stop.

type ContainerGroupsClientUpdateOptions added in v0.2.0

type ContainerGroupsClientUpdateOptions struct {
}

ContainerGroupsClientUpdateOptions contains the optional parameters for the ContainerGroupsClient.Update method.

type ContainerGroupsClientUpdateResponse added in v0.2.0

type ContainerGroupsClientUpdateResponse struct {
	ContainerGroup
}

ContainerGroupsClientUpdateResponse contains the response from method ContainerGroupsClient.Update.

type ContainerHTTPGet

type ContainerHTTPGet struct {
	// REQUIRED; The port number to probe.
	Port *int32 `json:"port,omitempty"`

	// The HTTP headers.
	HTTPHeaders []*HTTPHeader `json:"httpHeaders,omitempty"`

	// The path to probe.
	Path *string `json:"path,omitempty"`

	// The scheme.
	Scheme *Scheme `json:"scheme,omitempty"`
}

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.

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 `json:"port,omitempty"`

	// The protocol associated with the port.
	Protocol *ContainerNetworkProtocol `json:"protocol,omitempty"`
}

ContainerPort - The port exposed on the container instance.

type ContainerProbe

type ContainerProbe struct {
	// The execution command to probe
	Exec *ContainerExec `json:"exec,omitempty"`

	// The failure threshold.
	FailureThreshold *int32 `json:"failureThreshold,omitempty"`

	// The Http Get settings to probe
	HTTPGet *ContainerHTTPGet `json:"httpGet,omitempty"`

	// The initial delay seconds.
	InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"`

	// The period seconds.
	PeriodSeconds *int32 `json:"periodSeconds,omitempty"`

	// The success threshold.
	SuccessThreshold *int32 `json:"successThreshold,omitempty"`

	// The timeout seconds.
	TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
}

ContainerProbe - The container probe, for liveness or readiness

type ContainerProperties

type ContainerProperties struct {
	// REQUIRED; The name of the image used to create the container instance.
	Image *string `json:"image,omitempty"`

	// REQUIRED; The resource requirements of the container instance.
	Resources *ResourceRequirements `json:"resources,omitempty"`

	// The commands to execute within the container instance in exec form.
	Command []*string `json:"command,omitempty"`

	// The environment variables to set in the container instance.
	EnvironmentVariables []*EnvironmentVariable `json:"environmentVariables,omitempty"`

	// The liveness probe.
	LivenessProbe *ContainerProbe `json:"livenessProbe,omitempty"`

	// The exposed ports on the container instance.
	Ports []*ContainerPort `json:"ports,omitempty"`

	// The readiness probe.
	ReadinessProbe *ContainerProbe `json:"readinessProbe,omitempty"`

	// The volume mounts available to the container instance.
	VolumeMounts []*VolumeMount `json:"volumeMounts,omitempty"`

	// READ-ONLY; The instance view of the container instance. Only valid in response.
	InstanceView *ContainerPropertiesInstanceView `json:"instanceView,omitempty" azure:"ro"`
}

ContainerProperties - The container instance properties.

func (ContainerProperties) MarshalJSON

func (c ContainerProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ContainerProperties.

type ContainerPropertiesInstanceView

type ContainerPropertiesInstanceView struct {
	// READ-ONLY; Current container instance state.
	CurrentState *ContainerState `json:"currentState,omitempty" azure:"ro"`

	// READ-ONLY; The events of the container instance.
	Events []*Event `json:"events,omitempty" azure:"ro"`

	// READ-ONLY; Previous container instance state.
	PreviousState *ContainerState `json:"previousState,omitempty" azure:"ro"`

	// READ-ONLY; The number of times that the container instance has been restarted.
	RestartCount *int32 `json:"restartCount,omitempty" azure:"ro"`
}

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.

type ContainerState

type ContainerState struct {
	// READ-ONLY; The human-readable status of the container instance state.
	DetailStatus *string `json:"detailStatus,omitempty" azure:"ro"`

	// READ-ONLY; The container instance exit codes correspond to those from the docker run command.
	ExitCode *int32 `json:"exitCode,omitempty" azure:"ro"`

	// READ-ONLY; The date-time when the container instance state finished.
	FinishTime *time.Time `json:"finishTime,omitempty" azure:"ro"`

	// READ-ONLY; The date-time when the container instance state started.
	StartTime *time.Time `json:"startTime,omitempty" azure:"ro"`

	// READ-ONLY; The state of the container instance.
	State *string `json:"state,omitempty" azure:"ro"`
}

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 2021-10-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/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerAttach.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcontainerinstance.NewContainersClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Attach(ctx,
		"demo",
		"demo1",
		"container1",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
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 2021-10-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/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerExec.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcontainerinstance.NewContainersClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.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)
	}
	// TODO: use response item
	_ = res
}
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 2021-10-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/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerListLogs.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcontainerinstance.NewContainersClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.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)
	}
	// TODO: use response item
	_ = res
}
Output:

type ContainersClientAttachOptions added in v0.2.0

type ContainersClientAttachOptions struct {
}

ContainersClientAttachOptions contains the optional parameters for the ContainersClient.Attach method.

type ContainersClientAttachResponse added in v0.2.0

type ContainersClientAttachResponse struct {
	ContainerAttachResponse
}

ContainersClientAttachResponse contains the response from method ContainersClient.Attach.

type ContainersClientExecuteCommandOptions added in v0.2.0

type ContainersClientExecuteCommandOptions struct {
}

ContainersClientExecuteCommandOptions contains the optional parameters for the ContainersClient.ExecuteCommand method.

type ContainersClientExecuteCommandResponse added in v0.2.0

type ContainersClientExecuteCommandResponse struct {
	ContainerExecResponse
}

ContainersClientExecuteCommandResponse contains the response from method ContainersClient.ExecuteCommand.

type ContainersClientListLogsOptions added in v0.2.0

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 added in v0.2.0

type ContainersClientListLogsResponse struct {
	Logs
}

ContainersClientListLogsResponse contains the response from method ContainersClient.ListLogs.

type DNSConfiguration

type DNSConfiguration struct {
	// REQUIRED; The DNS servers for the container group.
	NameServers []*string `json:"nameServers,omitempty"`

	// The DNS options for the container group.
	Options *string `json:"options,omitempty"`

	// The DNS search domains for hostname lookup in the container group.
	SearchDomains *string `json:"searchDomains,omitempty"`
}

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.

type EncryptionProperties

type EncryptionProperties struct {
	// REQUIRED; The encryption key name.
	KeyName *string `json:"keyName,omitempty"`

	// REQUIRED; The encryption key version.
	KeyVersion *string `json:"keyVersion,omitempty"`

	// REQUIRED; The keyvault base url.
	VaultBaseURL *string `json:"vaultBaseUrl,omitempty"`
}

EncryptionProperties - The container group encryption properties.

type EnvironmentVariable

type EnvironmentVariable struct {
	// REQUIRED; The name of the environment variable.
	Name *string `json:"name,omitempty"`

	// The value of the secure environment variable.
	SecureValue *string `json:"secureValue,omitempty"`

	// The value of the environment variable.
	Value *string `json:"value,omitempty"`
}

EnvironmentVariable - The environment variable to set within the container instance.

type Event

type Event struct {
	// READ-ONLY; The count of the event.
	Count *int32 `json:"count,omitempty" azure:"ro"`

	// READ-ONLY; The date-time of the earliest logged event.
	FirstTimestamp *time.Time `json:"firstTimestamp,omitempty" azure:"ro"`

	// READ-ONLY; The date-time of the latest logged event.
	LastTimestamp *time.Time `json:"lastTimestamp,omitempty" azure:"ro"`

	// READ-ONLY; The event message.
	Message *string `json:"message,omitempty" azure:"ro"`

	// READ-ONLY; The event name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The event type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

Event - A container group or container instance event.

func (Event) MarshalJSON

func (e Event) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Event.

func (*Event) UnmarshalJSON

func (e *Event) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Event.

type GitRepoVolume

type GitRepoVolume struct {
	// REQUIRED; Repository URL
	Repository *string `json:"repository,omitempty"`

	// 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 `json:"directory,omitempty"`

	// Commit hash for the specified revision.
	Revision *string `json:"revision,omitempty"`
}

GitRepoVolume - Represents a volume that is populated with the contents of a git repository

type GpuResource

type GpuResource struct {
	// REQUIRED; The count of the GPU resource.
	Count *int32 `json:"count,omitempty"`

	// REQUIRED; The SKU of the GPU resource.
	SKU *GpuSKU `json:"sku,omitempty"`
}

GpuResource - The GPU resource.

type GpuSKU

type GpuSKU string

GpuSKU - The SKU of the GPU resource.

const (
	GpuSKUK80  GpuSKU = "K80"
	GpuSKUP100 GpuSKU = "P100"
	GpuSKUV100 GpuSKU = "V100"
)

func PossibleGpuSKUValues

func PossibleGpuSKUValues() []GpuSKU

PossibleGpuSKUValues returns the possible values for the GpuSKU const type.

type HTTPHeader

type HTTPHeader struct {
	// The header name.
	Name *string `json:"name,omitempty"`

	// The header value.
	Value *string `json:"value,omitempty"`
}

HTTPHeader - The HTTP header.

type IPAddress

type IPAddress struct {
	// REQUIRED; The list of ports exposed on the container group.
	Ports []*Port `json:"ports,omitempty"`

	// REQUIRED; Specifies if the IP is exposed to the public internet or private VNET.
	Type *ContainerGroupIPAddressType `json:"type,omitempty"`

	// The Dns name label for the IP.
	DNSNameLabel *string `json:"dnsNameLabel,omitempty"`

	// The value representing the security enum.
	DNSNameLabelReusePolicy *AutoGeneratedDomainNameLabelScope `json:"dnsNameLabelReusePolicy,omitempty"`

	// The IP exposed to the public internet.
	IP *string `json:"ip,omitempty"`

	// READ-ONLY; The FQDN for the IP.
	Fqdn *string `json:"fqdn,omitempty" azure:"ro"`
}

IPAddress - IP address for the container group.

func (IPAddress) MarshalJSON

func (i IPAddress) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller 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 `json:"server,omitempty"`

	// REQUIRED; The username for the private registry.
	Username *string `json:"username,omitempty"`

	// The identity for the private registry.
	Identity *string `json:"identity,omitempty"`

	// The identity URL for the private registry.
	IdentityURL *string `json:"identityUrl,omitempty"`

	// The password for the private registry.
	Password *string `json:"password,omitempty"`
}

ImageRegistryCredential - Image registry credential.

type InitContainerDefinition

type InitContainerDefinition struct {
	// REQUIRED; The name for the init container.
	Name *string `json:"name,omitempty"`

	// REQUIRED; The properties for the init container.
	Properties *InitContainerPropertiesDefinition `json:"properties,omitempty"`
}

InitContainerDefinition - The init container definition.

type InitContainerPropertiesDefinition

type InitContainerPropertiesDefinition struct {
	// The command to execute within the init container in exec form.
	Command []*string `json:"command,omitempty"`

	// The environment variables to set in the init container.
	EnvironmentVariables []*EnvironmentVariable `json:"environmentVariables,omitempty"`

	// The image of the init container.
	Image *string `json:"image,omitempty"`

	// The volume mounts available to the init container.
	VolumeMounts []*VolumeMount `json:"volumeMounts,omitempty"`

	// READ-ONLY; The instance view of the init container. Only valid in response.
	InstanceView *InitContainerPropertiesDefinitionInstanceView `json:"instanceView,omitempty" azure:"ro"`
}

InitContainerPropertiesDefinition - The init container definition properties.

func (InitContainerPropertiesDefinition) MarshalJSON

func (i InitContainerPropertiesDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type InitContainerPropertiesDefinition.

type InitContainerPropertiesDefinitionInstanceView

type InitContainerPropertiesDefinitionInstanceView struct {
	// READ-ONLY; The current state of the init container.
	CurrentState *ContainerState `json:"currentState,omitempty" azure:"ro"`

	// READ-ONLY; The events of the init container.
	Events []*Event `json:"events,omitempty" azure:"ro"`

	// READ-ONLY; The previous state of the init container.
	PreviousState *ContainerState `json:"previousState,omitempty" azure:"ro"`

	// READ-ONLY; The number of times that the init container has been restarted.
	RestartCount *int32 `json:"restartCount,omitempty" azure:"ro"`
}

InitContainerPropertiesDefinitionInstanceView - The instance view of the init container. Only valid in response.

func (InitContainerPropertiesDefinitionInstanceView) MarshalJSON

MarshalJSON implements the json.Marshaller 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 added in v0.4.0

NewListCachedImagesPager - Get the list of cached images on specific OS type for a subscription in a region. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-10-01 location - The identifier for the physical azure location. options - LocationClientListCachedImagesOptions contains the optional parameters for the LocationClient.ListCachedImages method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/CachedImagesList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcontainerinstance.NewLocationClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListCachedImagesPager("westcentralus",
		nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*LocationClient) NewListCapabilitiesPager added in v0.4.0

NewListCapabilitiesPager - Get the list of CPU/memory/GPU capabilities of a region. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-10-01 location - The identifier for the physical azure location. options - LocationClientListCapabilitiesOptions contains the optional parameters for the LocationClient.ListCapabilities method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/CapabilitiesList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcontainerinstance.NewLocationClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListCapabilitiesPager("westus",
		nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*LocationClient) NewListUsagePager added in v0.4.0

func (client *LocationClient) NewListUsagePager(location string, options *LocationClientListUsageOptions) *runtime.Pager[LocationClientListUsageResponse]

NewListUsagePager - Get the usage for a subscription If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-10-01 location - The identifier for the physical azure location. options - LocationClientListUsageOptions contains the optional parameters for the LocationClient.ListUsage method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/ContainerGroupUsage.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcontainerinstance.NewLocationClient("subid", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListUsagePager("westcentralus",
		nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

type LocationClientListCachedImagesOptions added in v0.2.0

type LocationClientListCachedImagesOptions struct {
}

LocationClientListCachedImagesOptions contains the optional parameters for the LocationClient.ListCachedImages method.

type LocationClientListCachedImagesResponse added in v0.2.0

type LocationClientListCachedImagesResponse struct {
	CachedImagesListResult
}

LocationClientListCachedImagesResponse contains the response from method LocationClient.ListCachedImages.

type LocationClientListCapabilitiesOptions added in v0.2.0

type LocationClientListCapabilitiesOptions struct {
}

LocationClientListCapabilitiesOptions contains the optional parameters for the LocationClient.ListCapabilities method.

type LocationClientListCapabilitiesResponse added in v0.2.0

type LocationClientListCapabilitiesResponse struct {
	CapabilitiesListResult
}

LocationClientListCapabilitiesResponse contains the response from method LocationClient.ListCapabilities.

type LocationClientListUsageOptions added in v0.2.0

type LocationClientListUsageOptions struct {
}

LocationClientListUsageOptions contains the optional parameters for the LocationClient.ListUsage method.

type LocationClientListUsageResponse added in v0.2.0

type LocationClientListUsageResponse struct {
	UsageListResult
}

LocationClientListUsageResponse contains the response from method LocationClient.ListUsage.

type LogAnalytics

type LogAnalytics struct {
	// REQUIRED; The workspace id for log analytics
	WorkspaceID *string `json:"workspaceId,omitempty"`

	// REQUIRED; The workspace key for log analytics
	WorkspaceKey *string `json:"workspaceKey,omitempty"`

	// The log type to be used.
	LogType *LogAnalyticsLogType `json:"logType,omitempty"`

	// Metadata for log analytics.
	Metadata map[string]*string `json:"metadata,omitempty"`

	// The workspace resource id for log analytics
	WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"`
}

LogAnalytics - Container group log analytics information.

func (LogAnalytics) MarshalJSON

func (l LogAnalytics) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller 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 `json:"content,omitempty"`
}

Logs - The 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 `json:"display,omitempty"`

	// REQUIRED; The name of the operation.
	Name *string `json:"name,omitempty"`

	// The intended executor of the operation.
	Origin *ContainerInstanceOperationsOrigin `json:"origin,omitempty"`

	// The additional properties.
	Properties interface{} `json:"properties,omitempty"`
}

Operation - An operation for Azure Container Instance service.

type OperationDisplay

type OperationDisplay struct {
	// The description of the operation.
	Description *string `json:"description,omitempty"`

	// The friendly name of the operation.
	Operation *string `json:"operation,omitempty"`

	// The name of the provider of the operation.
	Provider *string `json:"provider,omitempty"`

	// The name of the resource type of the operation.
	Resource *string `json:"resource,omitempty"`
}

OperationDisplay - The display information of the operation.

type OperationListResult

type OperationListResult struct {
	// The URI to fetch the next page of operations.
	NextLink *string `json:"nextLink,omitempty"`

	// The list of operations.
	Value []*Operation `json:"value,omitempty"`
}

OperationListResult - The operation list response that contains all operations for Azure Container Instance service.

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 added in v0.4.0

NewListPager - List the operations for Azure Container Instance service. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-10-01 options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2021-10-01/examples/OperationsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerinstance/armcontainerinstance"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armcontainerinstance.NewOperationsClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListPager(nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

type OperationsClientListOptions added in v0.2.0

type OperationsClientListOptions struct {
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.

type OperationsClientListResponse added in v0.2.0

type OperationsClientListResponse struct {
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.List.

type Port

type Port struct {
	// REQUIRED; The port number.
	Port *int32 `json:"port,omitempty"`

	// The protocol associated with the port.
	Protocol *ContainerGroupNetworkProtocol `json:"protocol,omitempty"`
}

Port - The port exposed on the container group.

type Resource

type Resource struct {
	// The resource location.
	Location *string `json:"location,omitempty"`

	// The resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// The zones for the container group.
	Zones []*string `json:"zones,omitempty"`

	// READ-ONLY; The resource id.
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The resource name.
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; The resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

Resource - The Resource model definition.

func (Resource) MarshalJSON

func (r Resource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller 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 (
	ResourceIdentityTypeSystemAssigned             ResourceIdentityType = "SystemAssigned"
	ResourceIdentityTypeUserAssigned               ResourceIdentityType = "UserAssigned"
	ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned"
	ResourceIdentityTypeNone                       ResourceIdentityType = "None"
)

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 `json:"cpu,omitempty"`

	// The GPU limit of this container instance.
	Gpu *GpuResource `json:"gpu,omitempty"`

	// The memory limit in GB of this container instance.
	MemoryInGB *float64 `json:"memoryInGB,omitempty"`
}

ResourceLimits - The resource limits.

type ResourceRequests

type ResourceRequests struct {
	// REQUIRED; The CPU request of this container instance.
	CPU *float64 `json:"cpu,omitempty"`

	// REQUIRED; The memory request in GB of this container instance.
	MemoryInGB *float64 `json:"memoryInGB,omitempty"`

	// The GPU request of this container instance.
	Gpu *GpuResource `json:"gpu,omitempty"`
}

ResourceRequests - The resource requests.

type ResourceRequirements

type ResourceRequirements struct {
	// REQUIRED; The resource requests of this container instance.
	Requests *ResourceRequests `json:"requests,omitempty"`

	// The resource limits of this container instance.
	Limits *ResourceLimits `json:"limits,omitempty"`
}

ResourceRequirements - The resource requirements.

type Scheme

type Scheme string

Scheme - The scheme.

const (
	SchemeHTTP  Scheme = "http"
	SchemeHTTPS Scheme = "https"
)

func PossibleSchemeValues

func PossibleSchemeValues() []Scheme

PossibleSchemeValues returns the possible values for the Scheme const type.

type Usage

type Usage struct {
	// READ-ONLY; The current usage of the resource
	CurrentValue *int32 `json:"currentValue,omitempty" azure:"ro"`

	// READ-ONLY; The maximum permitted usage of the resource.
	Limit *int32 `json:"limit,omitempty" azure:"ro"`

	// READ-ONLY; The name object of the resource
	Name *UsageName `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Unit of the usage result
	Unit *string `json:"unit,omitempty" azure:"ro"`
}

Usage - A single usage result

type UsageListResult

type UsageListResult struct {
	// READ-ONLY; The usage data.
	Value []*Usage `json:"value,omitempty" azure:"ro"`
}

UsageListResult - The response containing the usage data

type UsageName

type UsageName struct {
	// READ-ONLY; The localized name of the resource
	LocalizedValue *string `json:"localizedValue,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource
	Value *string `json:"value,omitempty" azure:"ro"`
}

UsageName - The name object of the resource

type Volume

type Volume struct {
	// REQUIRED; The name of the volume.
	Name *string `json:"name,omitempty"`

	// The Azure File volume.
	AzureFile *AzureFileVolume `json:"azureFile,omitempty"`

	// The empty directory volume.
	EmptyDir interface{} `json:"emptyDir,omitempty"`

	// The git repo volume.
	GitRepo *GitRepoVolume `json:"gitRepo,omitempty"`

	// The secret volume.
	Secret map[string]*string `json:"secret,omitempty"`
}

Volume - The properties of the volume.

func (Volume) MarshalJSON

func (v Volume) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller 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 `json:"mountPath,omitempty"`

	// REQUIRED; The name of the volume mount.
	Name *string `json:"name,omitempty"`

	// The flag indicating whether the volume mount is read-only.
	ReadOnly *bool `json:"readOnly,omitempty"`
}

VolumeMount - The properties of the volume mount.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL