Documentation ¶
Overview ¶
Package aci provides tools for interacting with the Azure Container Instances API.
Index ¶
- type AzureFileVolume
- type Client
- func (c *Client) CreateContainerGroup(resourceGroup, containerGroupName string, containerGroup ContainerGroup) (*ContainerGroup, error)
- func (c *Client) DeleteContainerGroup(resourceGroup, containerGroupName string) error
- func (c *Client) GetContainerGroup(resourceGroup, containerGroupName string) (*ContainerGroup, error, *int)
- func (c *Client) GetContainerLogs(resourceGroup, containerGroupName, containerName string, tail int) (*Logs, error)
- func (c *Client) LaunchExec(resourceGroup, containerGroupName, containerName, command string, ...) (ExecResponse, error)
- func (c *Client) ListContainerGroups(resourceGroup string) (*ContainerGroupListResult, error)
- func (c *Client) UpdateContainerGroup(resourceGroup, containerGroupName string, containerGroup ContainerGroup) (*ContainerGroup, error)
- type Container
- type ContainerExecProbe
- type ContainerGroup
- type ContainerGroupDiagnostics
- type ContainerGroupListResult
- type ContainerGroupNetworkProtocol
- type ContainerGroupProperties
- type ContainerGroupPropertiesInstanceView
- type ContainerGroupRestartPolicy
- type ContainerHTTPGetProbe
- type ContainerNetworkProtocol
- type ContainerPort
- type ContainerProbe
- type ContainerProperties
- type ContainerPropertiesInstanceView
- type ContainerState
- type EnvironmentVariable
- type Event
- type ExecRequest
- type ExecResponse
- type GitRepoVolume
- type IPAddress
- type ImageRegistryCredential
- type LogAnalyticsWorkspace
- type Logs
- type OperatingSystemTypes
- type Operation
- type OperationDisplay
- type OperationListResult
- type OperationsOrigin
- type Port
- type Resource
- type ResourceLimits
- type ResourceRequests
- type ResourceRequirements
- type TerminalSize
- type TerminalSizeRequest
- type Usage
- type UsageListResult
- type UsageName
- type Volume
- type VolumeMount
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AzureFileVolume ¶
type AzureFileVolume struct { ReadOnly bool `json:"readOnly,omitempty"` StorageAccountName string `json:"storageAccountName,omitempty"` StorageAccountKey string `json:"storageAccountKey,omitempty"` }
AzureFileVolume is the properties of the Azure File volume. Azure File shares are mounted as volumes.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for interacting with Azure Container Instances.
Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines.
func NewClient ¶
func NewClient(auth *azure.Authentication) (*Client, error)
NewClient creates a new Azure Container Instances client.
func (*Client) CreateContainerGroup ¶
func (c *Client) CreateContainerGroup(resourceGroup, containerGroupName string, containerGroup ContainerGroup) (*ContainerGroup, error)
CreateContainerGroup creates a new Azure Container Instance with the provided properties. From: https://docs.microsoft.com/en-us/rest/api/container-instances/containergroups/createorupdate
func (*Client) DeleteContainerGroup ¶
DeleteContainerGroup deletes an Azure Container Instance in the provided resource group with the given container group name. From: https://docs.microsoft.com/en-us/rest/api/container-instances/containergroups/delete
func (*Client) GetContainerGroup ¶
func (c *Client) GetContainerGroup(resourceGroup, containerGroupName string) (*ContainerGroup, error, *int)
GetContainerGroup gets an Azure Container Instance in the provided resource group with the given container group name. From: https://docs.microsoft.com/en-us/rest/api/container-instances/containergroups/get
func (*Client) GetContainerLogs ¶
func (c *Client) GetContainerLogs(resourceGroup, containerGroupName, containerName string, tail int) (*Logs, error)
GetContainerLogs returns the logs from an Azure Container Instance in the provided resource group with the given container group name. From: https://docs.microsoft.com/en-us/rest/api/container-instances/ContainerLogs/List
func (*Client) LaunchExec ¶ added in v0.4.1
func (c *Client) LaunchExec(resourceGroup, containerGroupName, containerName, command string, terminalSize remotecommand.TerminalSize) (ExecResponse, error)
Starts the exec command for a specified container instance in a specified resource group and container group. From: https://docs.microsoft.com/en-us/rest/api/container-instances/startcontainer/launchexec
func (*Client) ListContainerGroups ¶
func (c *Client) ListContainerGroups(resourceGroup string) (*ContainerGroupListResult, error)
ListContainerGroups lists an Azure Container Instance Groups, if a resource group is given it will list by resource group. It optionally accepts a resource group name and will filter based off of it if it is not empty. From: https://docs.microsoft.com/en-us/rest/api/container-instances/containergroups/list From: https://docs.microsoft.com/en-us/rest/api/container-instances/containergroups/listbyresourcegroup
func (*Client) UpdateContainerGroup ¶
func (c *Client) UpdateContainerGroup(resourceGroup, containerGroupName string, containerGroup ContainerGroup) (*ContainerGroup, error)
UpdateContainerGroup updates an Azure Container Instance with the provided properties. From: https://docs.microsoft.com/en-us/rest/api/container-instances/containergroups/createorupdate
type Container ¶
type Container struct { Name string `json:"name,omitempty"` ContainerProperties `json:"properties,omitempty"` }
Container is a container instance.
type ContainerExecProbe ¶ added in v0.5.0
type ContainerExecProbe struct {
Command []string `json:"command,omitempty"`
}
ContainerExecProbe defines a command based probe
type ContainerGroup ¶
type ContainerGroup struct { api.ResponseMetadata `json:"-"` ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` Location string `json:"location,omitempty"` Tags map[string]string `json:"tags,omitempty"` ContainerGroupProperties `json:"properties,omitempty"` }
ContainerGroup is a container group.
type ContainerGroupDiagnostics ¶ added in v0.5.0
type ContainerGroupDiagnostics struct {
LogAnalytics *LogAnalyticsWorkspace `json:"loganalytics,omitempty"`
}
ContainerGroupDiagnostics contains an instance of LogAnalyticsWorkspace
func NewContainerGroupDiagnostics ¶ added in v0.5.0
func NewContainerGroupDiagnostics(logAnalyticsID, logAnalyticsKey string) (*ContainerGroupDiagnostics, error)
func NewContainerGroupDiagnosticsFromFile ¶ added in v0.5.0
func NewContainerGroupDiagnosticsFromFile(filepath string) (*ContainerGroupDiagnostics, error)
type ContainerGroupListResult ¶
type ContainerGroupListResult struct { api.ResponseMetadata `json:"-"` Value []ContainerGroup `json:"value,omitempty"` NextLink string `json:"nextLink,omitempty"` }
ContainerGroupListResult is the container group list response that contains the container group properties.
type ContainerGroupNetworkProtocol ¶
type ContainerGroupNetworkProtocol string
ContainerGroupNetworkProtocol enumerates the values for container group network protocol.
const ( // TCP specifies the tcp state for container group network protocol. TCP ContainerGroupNetworkProtocol = "TCP" // UDP specifies the udp state for container group network protocol. UDP ContainerGroupNetworkProtocol = "UDP" )
type ContainerGroupProperties ¶
type ContainerGroupProperties struct { ProvisioningState string `json:"provisioningState,omitempty"` Containers []Container `json:"containers,omitempty"` ImageRegistryCredentials []ImageRegistryCredential `json:"imageRegistryCredentials,omitempty"` RestartPolicy ContainerGroupRestartPolicy `json:"restartPolicy,omitempty"` IPAddress *IPAddress `json:"ipAddress,omitempty"` OsType OperatingSystemTypes `json:"osType,omitempty"` Volumes []Volume `json:"volumes,omitempty"` InstanceView ContainerGroupPropertiesInstanceView `json:"instanceView,omitempty"` Diagnostics *ContainerGroupDiagnostics `json:"diagnostics,omitempty"` }
ContainerGroupProperties is
type ContainerGroupPropertiesInstanceView ¶
type ContainerGroupPropertiesInstanceView struct { Events []Event `json:"events,omitempty"` State string `json:"state,omitempty"` }
ContainerGroupPropertiesInstanceView is the instance view of the container group. Only valid in response.
type ContainerGroupRestartPolicy ¶
type ContainerGroupRestartPolicy string
ContainerGroupRestartPolicy enumerates the values for container group restart policy.
const ( // Always specifies the always state for container group restart policy. Always ContainerGroupRestartPolicy = "Always" // Never specifies the never state for container group restart policy. Never ContainerGroupRestartPolicy = "Never" // OnFailure specifies the on failure state for container group restart policy. OnFailure ContainerGroupRestartPolicy = "OnFailure" )
type ContainerHTTPGetProbe ¶ added in v0.5.0
type ContainerHTTPGetProbe struct { Port int `json:"port"` Path string `json:"path,omitempty"` Scheme string `json:"scheme,omitempty"` }
ContainerHTTPGetProbe defines an HTTP probe
type ContainerNetworkProtocol ¶
type ContainerNetworkProtocol string
ContainerNetworkProtocol enumerates the values for container network protocol.
const ( // ContainerNetworkProtocolTCP specifies the container network protocol tcp state for container network protocol. ContainerNetworkProtocolTCP ContainerNetworkProtocol = "TCP" // ContainerNetworkProtocolUDP specifies the container network protocol udp state for container network protocol. ContainerNetworkProtocolUDP ContainerNetworkProtocol = "UDP" )
type ContainerPort ¶
type ContainerPort struct { Protocol ContainerNetworkProtocol `json:"protocol,omitempty"` Port int32 `json:"port,omitempty"` }
ContainerPort is the port exposed on the container instance.
type ContainerProbe ¶ added in v0.5.0
type ContainerProbe struct { Exec *ContainerExecProbe `json:"exec,omitempty"` HTTPGet *ContainerHTTPGetProbe `json:"httpGet,omitempty"` InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty"` Period int32 `json:"periodSeconds,omitempty"` FailureThreshold int32 `json:"failureThreshold,omitempty"` SuccessThreshold int32 `json:"successThreshold,omitempty"` TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"` }
ContainerProbe is a probe definition that can be used for Liveness or Readiness checks.
type ContainerProperties ¶
type ContainerProperties struct { Image string `json:"image,omitempty"` Command []string `json:"command,omitempty"` Ports []ContainerPort `json:"ports,omitempty"` EnvironmentVariables []EnvironmentVariable `json:"environmentVariables,omitempty"` InstanceView ContainerPropertiesInstanceView `json:"instanceView,omitempty"` Resources ResourceRequirements `json:"resources,omitempty"` VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"` LivenessProbe *ContainerProbe `json:"livenessProbe,omitempty"` ReadinessProbe *ContainerProbe `json:"readinessProbe,omitempty"` }
ContainerProperties is the container instance properties.
type ContainerPropertiesInstanceView ¶
type ContainerPropertiesInstanceView struct { RestartCount int32 `json:"restartCount,omitempty"` CurrentState ContainerState `json:"currentState,omitempty"` PreviousState ContainerState `json:"previousState,omitempty"` Events []Event `json:"events,omitempty"` }
ContainerPropertiesInstanceView is the instance view of the container instance. Only valid in response.
type ContainerState ¶
type ContainerState struct { State string `json:"state,omitempty"` StartTime api.JSONTime `json:"startTime,omitempty"` ExitCode int32 `json:"exitCode,omitempty"` FinishTime api.JSONTime `json:"finishTime,omitempty"` DetailStatus string `json:"detailStatus,omitempty"` }
ContainerState is the container instance state.
type EnvironmentVariable ¶
type EnvironmentVariable struct { Name string `json:"name,omitempty"` Value string `json:"value,omitempty"` SecureValue string `json:"secureValue,omitempty"` }
EnvironmentVariable is the environment variable to set within the container instance.
type Event ¶
type Event struct { Count int32 `json:"count,omitempty"` FirstTimestamp api.JSONTime `json:"firstTimestamp,omitempty"` LastTimestamp api.JSONTime `json:"lastTimestamp,omitempty"` Name string `json:"name,omitempty"` Message string `json:"message,omitempty"` Type string `json:"type,omitempty"` }
Event is a container group or container instance event.
type ExecRequest ¶ added in v0.4.1
type ExecRequest struct { Command string `json:"command,omitempty"` TerminalSize TerminalSize `json:"terminalSize,omitempty"` }
ExecRequest is a request for Launch Exec API response for ACI.
type ExecResponse ¶ added in v0.4.1
type ExecResponse struct { WebSocketUri string `json:"webSocketUri,omitempty"` Password string `json:"password,omitempty"` }
ExecRequest is a request for Launch Exec API response for ACI.
type GitRepoVolume ¶
type GitRepoVolume struct { Directory string `json:"directory,omitempty"` Repository string `json:"repository,omitempty"` Revision string `json:"revision,omitempty"` }
GitRepoVolume is represents a volume that is populated with the contents of a git repository
type IPAddress ¶
type IPAddress struct { Ports []Port `json:"ports,omitempty"` Type string `json:"type,omitempty"` IP string `json:"ip,omitempty"` DNSNameLabel string `json:"dnsNameLabel,omitempty"` }
IPAddress is IP address for the container group.
type ImageRegistryCredential ¶
type ImageRegistryCredential struct { Server string `json:"server,omitempty"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` }
ImageRegistryCredential is image registry credential.
type LogAnalyticsWorkspace ¶ added in v0.5.0
type LogAnalyticsWorkspace struct { WorkspaceID string `json:"workspaceID,omitempty"` WorkspaceKey string `json:"workspaceKey,omitempty"` }
LogAnalyticsWorkspace defines details for a Log Analytics workspace
type Logs ¶
type Logs struct { api.ResponseMetadata `json:"-"` Content string `json:"content,omitempty"` }
Logs is the logs.
type OperatingSystemTypes ¶
type OperatingSystemTypes string
OperatingSystemTypes enumerates the values for operating system types.
const ( // Linux specifies the linux state for operating system types. Linux OperatingSystemTypes = "Linux" // Windows specifies the windows state for operating system types. Windows OperatingSystemTypes = "Windows" )
type Operation ¶
type Operation struct { Name string `json:"name,omitempty"` Display OperationDisplay `json:"display,omitempty"` Origin OperationsOrigin `json:"origin,omitempty"` }
Operation is an operation for Azure Container Instance service.
type OperationDisplay ¶
type OperationDisplay struct { Provider string `json:"provider,omitempty"` Resource string `json:"resource,omitempty"` Operation string `json:"operation,omitempty"` Description string `json:"description,omitempty"` }
OperationDisplay is the display information of the operation.
type OperationListResult ¶
type OperationListResult struct { api.ResponseMetadata `json:"-"` Value []Operation `json:"value,omitempty"` NextLink string `json:"nextLink,omitempty"` }
OperationListResult is the operation list response that contains all operations for Azure Container Instance service.
type OperationsOrigin ¶
type OperationsOrigin string
OperationsOrigin enumerates the values for operations origin.
const ( // System specifies the system state for operations origin. System OperationsOrigin = "System" // User specifies the user state for operations origin. User OperationsOrigin = "User" )
type Port ¶
type Port struct { Protocol ContainerGroupNetworkProtocol `json:"protocol,omitempty"` Port int32 `json:"port,omitempty"` }
Port is the port exposed on the container group.
type Resource ¶
type Resource struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` Location string `json:"location,omitempty"` Tags map[string]string `json:"tags,omitempty"` }
Resource is the Resource model definition.
type ResourceLimits ¶
type ResourceLimits struct { MemoryInGB float64 `json:"memoryInGB,omitempty"` CPU float64 `json:"cpu,omitempty"` }
ResourceLimits is the resource limits.
type ResourceRequests ¶
type ResourceRequests struct { MemoryInGB float64 `json:"memoryInGB,omitempty"` CPU float64 `json:"cpu,omitempty"` }
ResourceRequests is the resource requests.
type ResourceRequirements ¶
type ResourceRequirements struct { Requests *ResourceRequests `json:"requests,omitempty"` Limits *ResourceLimits `json:"limits,omitempty"` }
ResourceRequirements is the resource requirements.
type TerminalSize ¶ added in v0.4.1
TerminalSize is the size of the Launch Exec terminal
type TerminalSizeRequest ¶ added in v0.4.1
type Usage ¶
type Usage struct { Unit string `json:"unit,omitempty"` CurrentValue int32 `json:"currentValue,omitempty"` Limit int32 `json:"limit,omitempty"` Name UsageName `json:"name,omitempty"` }
Usage is a single usage result
type UsageListResult ¶
type UsageListResult struct { api.ResponseMetadata `json:"-"` Value []Usage `json:"value,omitempty"` }
UsageListResult is the response containing the usage data
type UsageName ¶
type UsageName struct { Value string `json:"value,omitempty"` LocalizedValue string `json:"localizedValue,omitempty"` }
UsageName is the name object of the resource
type Volume ¶
type Volume struct { Name string `json:"name,omitempty"` AzureFile *AzureFileVolume `json:"azureFile,omitempty"` EmptyDir map[string]interface{} `json:"emptyDir"` Secret map[string]string `json:"secret,omitempty"` GitRepo *GitRepoVolume `json:"gitRepo,omitempty"` }
Volume is the properties of the volume.
type VolumeMount ¶
type VolumeMount struct { Name string `json:"name,omitempty"` MountPath string `json:"mountPath,omitempty"` ReadOnly bool `json:"readOnly,omitempty"` }
VolumeMount is the properties of the volume mount.