aci

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package aci provides tools for interacting with the Azure Container Instances API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureFileVolume

type AzureFileVolume struct {
	ShareName          string `json:"shareName,omitempty"`
	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

func (c *Client) DeleteContainerGroup(resourceGroup, containerGroupName string) error

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) 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 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 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"`
}

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 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 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"`
}

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"`
}

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 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 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 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.

Jump to

Keyboard shortcuts

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