photon

package
v0.0.0-...-e3620ad Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2017 License: Apache-2.0 Imports: 17 Imported by: 38

Documentation

Index

Constants

View Source
const (
	ExtendedPropertyDNS              = "dns"
	ExtendedPropertyGateway          = "gateway"
	ExtendedPropertyNetMask          = "netmask"
	ExtendedPropertyLoadBalancerIP   = "load_balancer_ip"
	ExtendedPropertyNumberOfMasters  = "number_of_masters"
	ExtendedPropertyMasterIPs        = "master_ips"
	ExtendedPropertyMasterIP         = "master_ip"
	ExtendedPropertyMasterIP2        = "master_ip2"
	ExtendedPropertyContainerNetwork = "container_network"
	ExtendedPropertyNumberOfETCDs    = "number_of_etcds"
	ExtendedPropertyETCDIP1          = "etcd_ip1"
	ExtendedPropertyETCDIP2          = "etcd_ip2"
	ExtendedPropertyETCDIP3          = "etcd_ip3"
	ExtendedPropertySSHKey           = "ssh_key"
	ExtendedPropertyRegistryCACert   = "registry_ca_cert"
	ExtendedPropertyAdminPassword    = "admin_password"
)

Extended Properties

Variables

View Source
var InfraHostsUrl string = rootUrl + "/infrastructure/hosts"

Functions

func GetStep

func GetStep(s Step) string

Implement Go error interface for Step.

Types

type ApiError

type ApiError struct {
	Code           string                 `json:"code"`
	Data           map[string]interface{} `json:"data"`
	Message        string                 `json:"message"`
	HttpStatusCode int                    `json:"-"` // Not part of API contract
}

Represents an error from the Photon API.

func (ApiError) Error

func (e ApiError) Error() string

Implement Go error interface for ApiError

type AttachedDisk

type AttachedDisk struct {
	Flavor     string `json:"flavor"`
	Kind       string `json:"kind"`
	CapacityGB int    `json:"capacityGb,omitempty"`
	Name       string `json:"name"`
	State      string `json:"state"`
	ID         string `json:"id,omitempty"`
	BootDisk   bool   `json:"bootDisk"`
}

Represents a single attached disk.

type AuthAPI

type AuthAPI struct {
	// contains filtered or unexported fields
}

Contains functionality for auth API.

func (*AuthAPI) GetClientTokensByPassword

func (api *AuthAPI) GetClientTokensByPassword(username string, password string, clientID string) (tokenOptions *TokenOptions, err error)

Gets tokens for client from username, password and a client ID.

func (*AuthAPI) GetTokensByPassword

func (api *AuthAPI) GetTokensByPassword(username string, password string) (tokenOptions *TokenOptions, err error)

Gets Tokens from username/password.

func (*AuthAPI) GetTokensByRefreshToken

func (api *AuthAPI) GetTokensByRefreshToken(refreshtoken string) (tokenOptions *TokenOptions, err error)

Gets tokens from refresh token.

func (*AuthAPI) GetTokensFromWindowsLogInContext

func (api *AuthAPI) GetTokensFromWindowsLogInContext() (tokenOptions *TokenOptions, err error)

GetTokensFromWindowsLogInContext gets tokens based on Windows logged in context In case of running on platform other than Windows, it returns error

type AuthInfo

type AuthInfo struct {
	Password       string   `json:"password,omitempty"`
	Endpoint       string   `json:"endpoint,omitempty"`
	Domain         string   `json:"domain,omitempty"`
	Port           int      `json:"port,omitempty"`
	SecurityGroups []string `json:"securityGroups,omitempty"`
	Username       string   `json:"username,omitempty"`
}

Represents authentication information

type BaseCompact

type BaseCompact struct {
	Name string `json:"name"`
	ID   string `json:"id"`
}

type Client

type Client struct {
	Endpoint   string
	Tenants    *TenantsAPI
	Tasks      *TasksAPI
	Projects   *ProjectsAPI
	Flavors    *FlavorsAPI
	Images     *ImagesAPI
	Disks      *DisksAPI
	VMs        *VmAPI
	Hosts      *HostsAPI
	Datastores *DatastoresAPI
	Services   *ServicesAPI
	Auth       *AuthAPI
	Info       *InfoAPI
	Routers    *RoutersAPI
	Networks   *NetworksAPI
	Subnets    *SubnetsAPI
	System     *SystemAPI
	Zones      *ZonesAPI
	Infra      *InfraAPI
	InfraHosts *InfraHostsAPI
	// contains filtered or unexported fields
}

Represents stateless context needed to call photon APIs.

func NewClient

func NewClient(endpoint string, options *ClientOptions, logger *log.Logger) (c *Client)

Creates a new photon client with specified options. If options is nil, default options will be used.

func NewTestClient

func NewTestClient(endpoint string, options *ClientOptions, httpClient *http.Client) (c *Client)

Creates a new photon client with specified options and http.Client. Useful for functional testing where http calls must be mocked out. If options is nil, default options will be used.

type ClientOptions

type ClientOptions struct {
	// When using the Tasks.Wait APIs, defines the duration of how long
	// the SDK should continue to poll the server. Default is 30 minutes.
	// TasksAPI.WaitTimeout() can be used to specify timeout on
	// individual calls.
	TaskPollTimeout time.Duration

	// Whether or not to ignore any TLS errors when talking to photon,
	// false by default.
	IgnoreCertificate bool

	// List of root CA's to use for server validation
	// nil by default.
	RootCAs *x509.CertPool

	// For tasks APIs, defines the delay between each polling attempt.
	// Default is 100 milliseconds.
	TaskPollDelay time.Duration

	// For tasks APIs, defines the number of retries to make in the event
	// of an error. Default is 3.
	TaskRetryCount int

	// Tokens for user authentication. Default is empty.
	TokenOptions *TokenOptions

	// A function to be called if the access token was refreshed
	// The client can save the new access token for future API
	// calls so that it doesn't need to be refreshed again.
	UpdateAccessTokenCallback TokenCallback
}

Options for Client

type Component

type Component struct {
	Component string
	Message   string
	Status    string
}

Represents a component with status.

type Datastore

type Datastore struct {
	Kind     string   `json:"kind"`
	Type     string   `json:"type"`
	Tags     []string `json:"tags,omitempty"`
	ID       string   `json:"id"`
	SelfLink string   `json:"selfLink"`
}

type Datastores

type Datastores struct {
	Items []Datastore `json:"items"`
}

type DatastoresAPI

type DatastoresAPI struct {
	// contains filtered or unexported fields
}

DatastoresAPI is used by the client

func (*DatastoresAPI) Get

func (api *DatastoresAPI) Get(id string) (datastore *Datastore, err error)

Get returns a single datastore with the specified ID; requires system administrator privileges

func (*DatastoresAPI) GetAll

func (api *DatastoresAPI) GetAll() (result *Datastores, err error)

GetAll returns all datastores; requires system administrator privileges

type DiskCreateSpec

type DiskCreateSpec struct {
	Flavor     string         `json:"flavor"`
	Kind       string         `json:"kind"`
	CapacityGB int            `json:"capacityGb"`
	Affinities []LocalitySpec `json:"affinities,omitempty"`
	Name       string         `json:"name"`
	Tags       []string       `json:"tags,omitempty"`
}

Creation spec for disks.

type DiskGetOptions

type DiskGetOptions struct {
	Name string `urlParam:"name"`
}

Options for GetDisks API.

type DiskList

type DiskList struct {
	Items []PersistentDisk `json:"items"`
}

Represents multiple persistent disks returned by the API.

type DisksAPI

type DisksAPI struct {
	// contains filtered or unexported fields
}

Contains functionality for disks API.

func (*DisksAPI) Delete

func (api *DisksAPI) Delete(diskID string) (task *Task, err error)

Deletes a disk with the specified ID.

func (*DisksAPI) Get

func (api *DisksAPI) Get(diskID string) (disk *PersistentDisk, err error)

Gets a PersistentDisk for the disk with specified ID.

func (*DisksAPI) GetIam

func (api *DisksAPI) GetIam(id string) (policy []*RoleBinding, err error)

Gets IAM Policy on a disk.

func (*DisksAPI) GetTasks

func (api *DisksAPI) GetTasks(id string, options *TaskGetOptions) (result *TaskList, err error)

Gets all tasks with the specified disk ID, using options to filter the results. If options is nil, no filtering will occur.

func (*DisksAPI) ModifyIam

func (api *DisksAPI) ModifyIam(id string, policyDelta []*RoleBindingDelta) (task *Task, err error)

Modifies IAM Policy on a disk.

func (*DisksAPI) SetIam

func (api *DisksAPI) SetIam(id string, policy []*RoleBinding) (task *Task, err error)

Sets IAM Policy on a disk.

type Entity

type Entity struct {
	ID   string `json:"id"`
	Kind string `json:"kind"`
}

type Flavor

type Flavor struct {
	Cost     []QuotaLineItem `json:"cost"`
	Kind     string          `json:"kind"`
	Name     string          `json:"name"`
	ID       string          `json:"id"`
	Tags     []string        `json:"tags"`
	SelfLink string          `json:"selfLink"`
	State    string          `json:"state"`
}

Represents a single flavor.

type FlavorCreateSpec

type FlavorCreateSpec struct {
	Cost []QuotaLineItem `json:"cost"`
	Kind string          `json:"kind"`
	Name string          `json:"name"`
}

Creation spec for flavors.

type FlavorGetOptions

type FlavorGetOptions struct {
	Name string `urlParam:"name"`
	Kind string `urlParam:"kind"`
}

Options used for find/get APIs

type FlavorList

type FlavorList struct {
	Items []Flavor `json:"items"`
}

Represents multiple flavors returned by the API.

type FlavorsAPI

type FlavorsAPI struct {
	// contains filtered or unexported fields
}

Contains functionality for flavors API.

func (*FlavorsAPI) Create

func (api *FlavorsAPI) Create(spec *FlavorCreateSpec) (task *Task, err error)

Creates a flavor.

func (*FlavorsAPI) Delete

func (api *FlavorsAPI) Delete(flavorID string) (task *Task, err error)

Deletes flavor with specified ID.

func (*FlavorsAPI) Get

func (api *FlavorsAPI) Get(flavorID string) (flavor *Flavor, err error)

Gets details of flavor with specified ID.

func (*FlavorsAPI) GetAll

func (api *FlavorsAPI) GetAll(options *FlavorGetOptions) (flavors *FlavorList, err error)

Gets flavors using options to filter results. Returns all flavors if options is nil.

func (*FlavorsAPI) GetTasks

func (api *FlavorsAPI) GetTasks(id string, options *TaskGetOptions) (result *TaskList, err error)

Gets all tasks with the specified flavor ID, using options to filter the results. If options is nil, no filtering will occur.

type Host

type Host struct {
	Username   string            `json:"username"`
	Password   string            `json:"password"`
	Address    string            `json:"address"`
	Kind       string            `json:"kind"`
	ID         string            `json:"id"`
	Zone       string            `json:"zone,omitempty"`
	Tags       []string          `json:"usageTags"`
	Metadata   map[string]string `json:"metadata,omitempty"`
	SelfLink   string            `json:"selfLink"`
	State      string            `json:"state"`
	EsxVersion string            `json:"esxVersion"`
}

Represents a host

type HostCreateSpec

type HostCreateSpec struct {
	Username string            `json:"username"`
	Password string            `json:"password"`
	Zone     string            `json:"zone,omitempty"`
	Metadata map[string]string `json:"metadata,omitempty"`
	Address  string            `json:"address"`
	Tags     []string          `json:"usageTags"`
}

Creation spec for hosts.

type HostSetAvailabilityZoneOperation

type HostSetAvailabilityZoneOperation struct {
	AvailabilityZoneId string `json:"availabilityZoneId"`
}

Represents availability zone that can be set for host

type Hosts

type Hosts struct {
	Items []Host `json:"items"`
}

Represents multiple hosts returned by the API.

type HostsAPI

type HostsAPI struct {
	// contains filtered or unexported fields
}

Contains functionality for hosts API.

func (*HostsAPI) GetTasks

func (api *HostsAPI) GetTasks(id string, options *TaskGetOptions) (result *TaskList, err error)

Gets all tasks with the specified host ID, using options to filter the results. If options is nil, no filtering will occur.

func (*HostsAPI) Provision

func (api *HostsAPI) Provision(id string) (task *Task, err error)

provision the host with the specified id

func (*HostsAPI) SetAvailabilityZone

func (api *HostsAPI) SetAvailabilityZone(id string, availabilityZone *HostSetAvailabilityZoneOperation) (task *Task, err error)

Sets host's availability zone.

type HttpError

type HttpError struct {
	StatusCode int
	Message    string
}

Used to represent a generic HTTP error, i.e. an unexpected HTTP 500.

func (HttpError) Error

func (e HttpError) Error() string

Implementation of error interface for HttpError

type ISO

type ISO struct {
	Size int64  `json:"size,omitempty"`
	Kind string `json:"kind,omitempty"`
	Name string `json:"name"`
	ID   string `json:"id"`
}

Represents an ISO.

type Image

type Image struct {
	Size                int64          `json:"size"`
	Kind                string         `json:"kind"`
	Name                string         `json:"name"`
	State               string         `json:"state"`
	ID                  string         `json:"id"`
	Tags                []string       `json:"tags"`
	Scope               ImageScope     `json:"scope"`
	SelfLink            string         `json:"selfLink"`
	Settings            []ImageSetting `json:"settings"`
	ReplicationType     string         `json:"replicationType"`
	ReplicationProgress string         `json:"replicationProgress"`
	SeedingProgress     string         `json:"seedingProgress"`
}

Represents an image.

type ImageCreateOptions

type ImageCreateOptions struct {
	ReplicationType string
}

Creation spec for images.

type ImageCreateSpec

type ImageCreateSpec struct {
	Name            string `json:"name"`
	ReplicationType string `json:"replicationType"`
}

Image creation spec.

type ImageDatastores

type ImageDatastores struct {
	Items []string `json:"items"`
}

Represents the list of image datastores.

type ImageGetOptions

type ImageGetOptions struct {
	Name string `urlParam:"name"`
}

Options for GetImage API.

type ImageScope

type ImageScope struct {
	Kind string `json:"kind"`
	ID   string `json:"id"`
}

Represents an image scope.

type ImageSetting

type ImageSetting struct {
	Name         string `json:"name"`
	DefaultValue string `json:"defaultValue"`
}

Represents an image setting.

type Images

type Images struct {
	Items []Image `json:"items"`
}

Represents multiple images returned by the API.

type ImagesAPI

type ImagesAPI struct {
	// contains filtered or unexported fields
}

Contains functionality for images API.

func (*ImagesAPI) Create

func (api *ImagesAPI) Create(reader io.ReadSeeker, name string, options *ImageCreateOptions) (task *Task, err error)

Uploads a new image, reading from the specified io.Reader. Name is a descriptive name of the image, it is used in the filename field of the Content-Disposition header, and does not need to be unique. If options is nil, default options are used.

func (*ImagesAPI) CreateFromFile

func (api *ImagesAPI) CreateFromFile(imagePath string, options *ImageCreateOptions) (task *Task, err error)

Uploads a new image, reading from the specified image path. If options is nil, default options are used.

func (*ImagesAPI) Delete

func (api *ImagesAPI) Delete(imageID string) (task *Task, err error)

Deletes image with the specified ID.

func (*ImagesAPI) Get

func (api *ImagesAPI) Get(imageID string) (image *Image, err error)

Gets details of image with the specified ID.

func (*ImagesAPI) GetAll

func (api *ImagesAPI) GetAll(options *ImageGetOptions) (images *Images, err error)

Gets all images on this photon instance.

func (*ImagesAPI) GetIam

func (api *ImagesAPI) GetIam(imageID string) (policy []*RoleBinding, err error)

Gets IAM Policy of an image.

func (*ImagesAPI) GetTasks

func (api *ImagesAPI) GetTasks(id string, options *TaskGetOptions) (result *TaskList, err error)

Gets all tasks with the specified image ID, using options to filter the results. If options is nil, no filtering will occur.

func (*ImagesAPI) ModifyIam

func (api *ImagesAPI) ModifyIam(imageID string, policyDelta []*RoleBindingDelta) (task *Task, err error)

Modifies IAM Policy on an image.

func (*ImagesAPI) SetIam

func (api *ImagesAPI) SetIam(imageID string, policy []*RoleBinding) (task *Task, err error)

Sets IAM Policy on an image.

type Info

type Info struct {
	BaseVersion   string `json:"baseVersion"`
	FullVersion   string `json:"fullVersion"`
	GitCommitHash string `json:"gitCommitHash"`
	NetworkType   string `json:"networkType"`
}

Represents deployment info

type InfoAPI

type InfoAPI struct {
	// contains filtered or unexported fields
}

func (*InfoAPI) Get

func (api *InfoAPI) Get() (info *Info, err error)

Get info

type InfraAPI

type InfraAPI struct {
	// contains filtered or unexported fields
}

Contains functionality for Infrastructure API.

func (*InfraAPI) SetImageDatastores

func (api *InfraAPI) SetImageDatastores(imageDatastores *ImageDatastores) (task *Task, err error)

Set image datastores.

func (*InfraAPI) SyncHostsConfig

func (api *InfraAPI) SyncHostsConfig() (task *Task, err error)

Synchronizes hosts configurations

type InfraHostsAPI

type InfraHostsAPI struct {
	// contains filtered or unexported fields
}

Contains functionality for infrastructure hosts API.

func (*InfraHostsAPI) Create

func (api *InfraHostsAPI) Create(hostSpec *HostCreateSpec) (task *Task, err error)

Register a host with photon platform

func (*InfraHostsAPI) Delete

func (api *InfraHostsAPI) Delete(id string) (task *Task, err error)

Deletes a host with specified ID.

func (*InfraHostsAPI) EnterMaintenanceMode

func (api *InfraHostsAPI) EnterMaintenanceMode(id string) (task *Task, err error)

Host with the specified id enter maintenance mode

func (*InfraHostsAPI) ExitMaintenanceMode

func (api *InfraHostsAPI) ExitMaintenanceMode(id string) (task *Task, err error)

Host with the specified id exit maintenance mode

func (*InfraHostsAPI) Get

func (api *InfraHostsAPI) Get(id string) (host *Host, err error)

Gets a host with the specified ID.

func (*InfraHostsAPI) GetHosts

func (api *InfraHostsAPI) GetHosts() (result *Hosts, err error)

Gets all hosts.

func (*InfraHostsAPI) GetVMs

func (api *InfraHostsAPI) GetVMs(id string) (result *VMs, err error)

Gets all the VMs with the specified host ID.

func (*InfraHostsAPI) Resume

func (api *InfraHostsAPI) Resume(id string) (task *Task, err error)

Resume the host with the specified id

func (*InfraHostsAPI) Suspend

func (api *InfraHostsAPI) Suspend(id string) (task *Task, err error)

Suspend the host with the specified id

type IpRange

type IpRange struct {
	Start string `json:"start,omitempty"`
	End   string `json:"end,omitempty"`
}

Represents ip range

type LocalitySpec

type LocalitySpec struct {
	Kind string `json:"kind"`
	ID   string `json:"id"`
}

Creation spec for locality.

type Network

type Network struct {
	ID            string `json:"id"`
	Kind          string `json:"kind"`
	Name          string `json:"name"`
	PrivateIpCidr string `json:"privateIpCidr"`
	IsDefault     bool   `json:"isDefault"`
}

Represents a network

type NetworkConfiguration

type NetworkConfiguration struct {
	Enabled         bool     `json:"sdnEnabled,omitempty"`
	Address         string   `json:"networkManagerAddress,omitempty"`
	Username        string   `json:"networkManagerUsername,omitempty"`
	Password        string   `json:"networkManagerPassword,omitempty"`
	NetworkZoneId   string   `json:"networkZoneId,omitempty"`
	TopRouterId     string   `json:"networkTopRouterId,omitempty"`
	EdgeIpPoolId    string   `json:"networkEdgeIpPoolId,omitempty"`
	HostUplinkPnic  string   `json:"networkHostUplinkPnic,omitempty"`
	IpRange         string   `json:"ipRange,omitempty"`
	FloatingIpRange *IpRange `json:"floatingIpRange,omitempty"`
	SnatIp          string   `json:"snatIp,omitempty"`
}

Represents network configuration.

type NetworkConfigurationCreateSpec

type NetworkConfigurationCreateSpec struct {
	Enabled         bool     `json:"sdnEnabled,omitempty"`
	Address         string   `json:"networkManagerAddress,omitempty"`
	Username        string   `json:"networkManagerUsername,omitempty"`
	Password        string   `json:"networkManagerPassword,omitempty"`
	NetworkZoneId   string   `json:"networkZoneId,omitempty"`
	TopRouterId     string   `json:"networkTopRouterId,omitempty"`
	EdgeIpPoolId    string   `json:"networkEdgeIpPoolId,omitempty"`
	HostUplinkPnic  string   `json:"networkHostUplinkPnic,omitempty"`
	IpRange         string   `json:"ipRange,omitempty"`
	ExternalIpRange *IpRange `json:"externalIpRange,omitempty"`
}

Represents creation spec for network configuration.

type NetworkCreateSpec

type NetworkCreateSpec struct {
	Name          string `json:"name"`
	PrivateIpCidr string `json:"privateIpCidr"`
}

type NetworkGetOptions

type NetworkGetOptions struct {
	Name string `urlParam:"name"`
}

Options for GetNetworks API.

type NetworkUpdateSpec

type NetworkUpdateSpec struct {
	NetworkName string `json:"name"`
}

Represents name that can be set for network

type Networks

type Networks struct {
	Items []Network `json:"items"`
}

Represents multiple networks returned by the API.

type NetworksAPI

type NetworksAPI struct {
	// contains filtered or unexported fields
}

Contains functionality for networks API.

func (*NetworksAPI) CreateSubnet

func (api *NetworksAPI) CreateSubnet(networkID string, spec *SubnetCreateSpec) (task *Task, err error)

Creates a subnet on the specified network.

func (*NetworksAPI) Delete

func (api *NetworksAPI) Delete(networkID string) (task *Task, err error)

Deletes a network with specified ID.

func (*NetworksAPI) Get

func (api *NetworksAPI) Get(id string) (network *Network, err error)

Gets a network with the specified ID.

func (*NetworksAPI) GetSubnets

func (api *NetworksAPI) GetSubnets(networkID string, options *SubnetGetOptions) (result *Subnets, err error)

Gets subnets for network with the specified ID, using options to filter the results. If options is nil, no filtering will occur.

func (*NetworksAPI) UpdateNetwork

func (api *NetworksAPI) UpdateNetwork(id string, networkSpec *NetworkUpdateSpec) (task *Task, err error)

Updates network's attributes.

type NsxConfigurationSpec

type NsxConfigurationSpec struct {
	NsxAddress             string            `json:"nsxAddress"`
	NsxUsername            string            `json:"nsxUsername"`
	NsxPassword            string            `json:"nsxPassword"`
	DhcpServerAddresses    map[string]string `json:"dhcpServerAddresses"`
	FloatingIpRootRange    IpRange           `json:"floatingIpRootRange"`
	T0RouterId             string            `json:"t0RouterId"`
	EdgeClusterId          string            `json:"edgeClusterId"`
	OverlayTransportZoneId string            `json:"overlayTransportZoneId"`
	TunnelIpPoolId         string            `json:"tunnelIpPoolId"`
	HostUplinkPnic         string            `json:"hostUplinkPnic"`
	HostUplinkVlanId       int               `json:"hostUplinkVlanId"`
	DnsServerAddresses     []string          `json:"dnsServerAddresses"`
}

NSX configuration spec

type PersistentDisk

type PersistentDisk struct {
	Flavor     string          `json:"flavor"`
	Cost       []QuotaLineItem `json:"cost"`
	Kind       string          `json:"kind"`
	Datastore  string          `json:"datastore,omitempty"`
	CapacityGB int             `json:"capacityGb,omitempty"`
	Name       string          `json:"name"`
	State      string          `json:"state"`
	ID         string          `json:"id"`
	VMs        []string        `json:"vms"`
	Tags       []string        `json:"tags,omitempty"`
	SelfLink   string          `json:"selfLink,omitempty"`
}

Represents a persistent disk.

type PortGroups

type PortGroups struct {
	Names []string `json:"names"`
}

Represents port groups.

type ProjectCompact

type ProjectCompact struct {
	Kind           string          `json:"kind"`
	Name           string          `json:"name"`
	ID             string          `json:"id"`
	Tags           []string        `json:"tags"`
	SelfLink       string          `json:"selfLink"`
	SecurityGroups []SecurityGroup `json:"securityGroups"`
	ResourceQuota  Quota           `json:"quota,omitempty"`
}

Compact representation of projects.

type ProjectCreateSpec

type ProjectCreateSpec struct {
	Name                       string   `json:"name"`
	SecurityGroups             []string `json:"securityGroups,omitempty"`
	DefaultRouterPrivateIpCidr string   `json:"defaultRouterPrivateIpCidr,omitempty"`
	ResourceQuota              Quota    `json:"quota,omitempty"`
}

Creation spec for projects.

type ProjectGetOptions

type ProjectGetOptions struct {
	Name string `urlParam:"name"`
}

Options for GetProjects API.

type ProjectList

type ProjectList struct {
	Items []ProjectCompact `json:"items"`
}

Represents multiple projects returned by the API.

type ProjectsAPI

type ProjectsAPI struct {
	// contains filtered or unexported fields
}

Contains functionality for projects API.

func (*ProjectsAPI) CreateDisk

func (api *ProjectsAPI) CreateDisk(projectID string, spec *DiskCreateSpec) (task *Task, err error)

Creates a disk on the specified project.

func (*ProjectsAPI) CreateImage

func (api *ProjectsAPI) CreateImage(projectID string, reader io.ReadSeeker, name string, options *ImageCreateOptions) (task *Task, err error)

Creates an image on the specified project.

func (*ProjectsAPI) CreateNetwork

func (api *ProjectsAPI) CreateNetwork(projectID string, spec *NetworkCreateSpec) (task *Task, err error)

Creates a network on the specified project.

func (*ProjectsAPI) CreateRouter

func (api *ProjectsAPI) CreateRouter(projectID string, spec *RouterCreateSpec) (task *Task, err error)

Creates a router on the specified project.

func (*ProjectsAPI) CreateService

func (api *ProjectsAPI) CreateService(projectID string, spec *ServiceCreateSpec) (task *Task, err error)

Creates a service on the specified project.

func (*ProjectsAPI) CreateVM

func (api *ProjectsAPI) CreateVM(projectID string, spec *VmCreateSpec) (task *Task, err error)

Creates a VM on the specified project.

func (*ProjectsAPI) Delete

func (api *ProjectsAPI) Delete(projectID string) (task *Task, err error)

Deletes the project with specified ID. Any VMs, disks, etc., owned by the project must be deleted first.

func (*ProjectsAPI) ExcludeQuota

func (api *ProjectsAPI) ExcludeQuota(projectId string, spec *QuotaSpec) (task *Task, err error)

Exclude project quota line items from the specific quota spec.

func (*ProjectsAPI) Get

func (api *ProjectsAPI) Get(id string) (project *ProjectCompact, err error)

Gets the project with a specified ID.

func (*ProjectsAPI) GetDisks

func (api *ProjectsAPI) GetDisks(projectID string, options *DiskGetOptions) (result *DiskList, err error)

Gets disks for project with the specified ID, using options to filter the results. If options is nil, no filtering will occur.

func (*ProjectsAPI) GetIam

func (api *ProjectsAPI) GetIam(projectId string) (policy []*RoleBinding, err error)

Gets IAM Policy of a project.

func (*ProjectsAPI) GetNetworks

func (api *ProjectsAPI) GetNetworks(projectID string, options *NetworkGetOptions) (result *Networks, err error)

Gets networks for project with the specified ID, using options to filter the results. If options is nil, no filtering will occur.

func (*ProjectsAPI) GetQuota

func (api *ProjectsAPI) GetQuota(projectId string) (quota *Quota, err error)

Get quota for project with the specified ID.

func (*ProjectsAPI) GetRouters

func (api *ProjectsAPI) GetRouters(projectID string, options *RouterGetOptions) (result *Routers, err error)

Gets routers for project with the specified ID, using options to filter the results. If options is nil, no filtering will occur.

func (*ProjectsAPI) GetServices

func (api *ProjectsAPI) GetServices(projectID string) (result *Services, err error)

Gets services for project with the specified ID

func (*ProjectsAPI) GetTasks

func (api *ProjectsAPI) GetTasks(id string, options *TaskGetOptions) (result *TaskList, err error)

Gets all tasks with the specified project ID, using options to filter the results. If options is nil, no filtering will occur.

func (*ProjectsAPI) GetVMs

func (api *ProjectsAPI) GetVMs(projectID string, options *VmGetOptions) (result *VMs, err error)

Gets vms for project with the specified ID, using options to filter the results. If options is nil, no filtering will occur.

func (*ProjectsAPI) ModifyIam

func (api *ProjectsAPI) ModifyIam(projectId string, policyDelta []*RoleBindingDelta) (task *Task, err error)

Modifies IAM Policy on a project.

func (*ProjectsAPI) SetIam

func (api *ProjectsAPI) SetIam(projectId string, policy []*RoleBinding) (task *Task, err error)

Sets IAM Policy on a project.

func (*ProjectsAPI) SetQuota

func (api *ProjectsAPI) SetQuota(projectId string, spec *QuotaSpec) (task *Task, err error)

Set (replace) the whole project quota with the quota line items specified in quota spec.

func (*ProjectsAPI) SetSecurityGroups

func (api *ProjectsAPI) SetSecurityGroups(projectID string, securityGroups *SecurityGroupsSpec) (*Task, error)

Set security groups for this project, overwriting any existing ones.

func (*ProjectsAPI) UpdateQuota

func (api *ProjectsAPI) UpdateQuota(projectId string, spec *QuotaSpec) (task *Task, err error)

Update portion of the project quota with the quota line items specified in quota spec.

type Quota

type Quota struct {
	QuotaLineItems map[string]QuotaStatusLineItem `json:"quotaItems"`
}

Represents the quota

type QuotaLineItem

type QuotaLineItem struct {
	Unit  string  `json:"unit"`
	Value float64 `json:"value"`
	Key   string  `json:"key"`
}

type QuotaSpec

type QuotaSpec map[string]QuotaStatusLineItem

QuotaSpec is used when set/update/excluding QuotaLineItems from existing Quota

type QuotaStatusLineItem

type QuotaStatusLineItem struct {
	Unit  string  `json:"unit"`
	Limit float64 `json:"limit"`
	Usage float64 `json:"usage"`
}

The QuotaLineItem with limit and usage in one place.

type ResourceTicketGetOptions

type ResourceTicketGetOptions struct {
	Name string `urlParam:"name"`
}

Options for GetResourceTickets API.

type RoleBinding

type RoleBinding struct {
	Role     string   `json:"role"`
	Subjects []string `json:"subjects"`
}

Identity and Access Management (IAM) IAM role binding

type RoleBindingDelta

type RoleBindingDelta struct {
	Action  string `json:"action"`
	Role    string `json:"role"`
	Subject string `json:"subject"`
}

type Router

type Router struct {
	ID            string `json:"id"`
	Kind          string `json:"kind"`
	Name          string `json:"name"`
	PrivateIpCidr string `json:"privateIpCidr"`
	IsDefault     bool   `json:"isDefault"`
}

Represents a router

type RouterCreateSpec

type RouterCreateSpec struct {
	Name          string `json:"name"`
	PrivateIpCidr string `json:"privateIpCidr"`
}

type RouterGetOptions

type RouterGetOptions struct {
	Name string `urlParam:"name"`
}

Options for GetRouters API.

type RouterUpdateSpec

type RouterUpdateSpec struct {
	RouterName string `json:"name"`
}

Represents name that can be set for router

type Routers

type Routers struct {
	Items []Router `json:"items"`
}

Represents multiple routers returned by the API.

type RoutersAPI

type RoutersAPI struct {
	// contains filtered or unexported fields
}

Contains functionality for routers API.

func (*RoutersAPI) CreateSubnet

func (api *RoutersAPI) CreateSubnet(routerID string, spec *SubnetCreateSpec) (task *Task, err error)

Creates a subnet on the specified router.

func (*RoutersAPI) Delete

func (api *RoutersAPI) Delete(routerID string) (task *Task, err error)

Deletes a router with specified ID.

func (*RoutersAPI) Get

func (api *RoutersAPI) Get(id string) (router *Router, err error)

Gets a router with the specified ID.

func (*RoutersAPI) GetSubnets

func (api *RoutersAPI) GetSubnets(routerID string, options *SubnetGetOptions) (result *Subnets, err error)

Gets subnets for router with the specified ID, using options to filter the results. If options is nil, no filtering will occur.

func (*RoutersAPI) UpdateRouter

func (api *RoutersAPI) UpdateRouter(id string, routerSpec *RouterUpdateSpec) (task *Task, err error)

Updates router's attributes.

type SdkError

type SdkError struct {
	Message string
}

Implement a generic sdk error

func (SdkError) Error

func (e SdkError) Error() string

type SecurityGroup

type SecurityGroup struct {
	Name      string `json:"name"`
	Inherited bool   `json:"inherited"`
}

Represents a security group

type SecurityGroupsSpec

type SecurityGroupsSpec struct {
	Items []string `json:"items"`
}

Represents set_security_groups spec

type Service

type Service struct {
	Kind               string                `json:"kind"`
	Name               string                `json:"name"`
	State              string                `json:"state"`
	ID                 string                `json:"id"`
	Type               string                `json:"type"`
	ImageID            string                `json:"imageId"`
	UpgradeStatus      *ServiceUpgradeStatus `json:"upgradeStatus,omitempty"`
	ProjectID          string                `json:"projectID,omitempty"`
	ClientID           string                `json:"clientId,omitempty"`
	WorkerCount        int                   `json:"workerCount"`
	SelfLink           string                `json:"selfLink,omitempty"`
	ErrorReason        string                `json:"errorReason,omitempty"`
	ExtendedProperties map[string]string     `json:"extendedProperties"`
}

Represents a service.

type ServiceChangeVersionOperation

type ServiceChangeVersionOperation struct {
	NewImageID string `json:"newImageId"`
}

Represents service imageId that can be updated during change version

type ServiceConfiguration

type ServiceConfiguration struct {
	Kind    string `json:"kind"`
	Type    string `json:"type"`
	ImageID string `json:"imageId"`
}

Represnts a Service configuration.

type ServiceConfigurationSpec

type ServiceConfigurationSpec struct {
	Type    string `json:"type"`
	ImageID string `json:"imageId"`
}

Creation spec for Service Configuration.

type ServiceCreateSpec

type ServiceCreateSpec struct {
	Name               string            `json:"name"`
	Type               string            `json:"type"`
	VMFlavor           string            `json:"vmFlavor,omitempty"`
	MasterVmFlavor     string            `json:"masterVmFlavor,omitempty"`
	WorkerVmFlavor     string            `json:"workerVmFlavor,omitempty"`
	DiskFlavor         string            `json:"diskFlavor,omitempty"`
	SubnetId           string            `json:"subnetId,omitempty"`
	ImageID            string            `json:"imageId,omitempty"`
	WorkerCount        int               `json:"workerCount"`
	BatchSizeWorker    int               `json:"workerBatchExpansionSize,omitempty"`
	ExtendedProperties map[string]string `json:"extendedProperties"`
}

Creation spec for services.

type ServiceResizeOperation

type ServiceResizeOperation struct {
	NewWorkerCount int `json:"newWorkerCount"`
}

Represents service size that can be resized for service

type ServiceUpgradeStatus

type ServiceUpgradeStatus struct {
	NewImageID           string `json:"newImageId"`
	UpgradeMessage       string `json:"upgradeMessage,omitempty"`
	TotalNodes           int    `json:"totalNodes,omitempty"`
	NumNodesUpgraded     int    `json:"numNodesUpgraded"`
	UpgradeResultMessage string `json:"upgradeResultMessage,omitempty"`
}

Represents the status of a service during upgrade.

type Services

type Services struct {
	Items []Service `json:"items"`
}

Represents multiple services returned by the API

type ServicesAPI

type ServicesAPI struct {
	// contains filtered or unexported fields
}

Contains functionality for services API.

func (*ServicesAPI) ChangeVersion

func (api *ServicesAPI) ChangeVersion(id string, changeVersion *ServiceChangeVersionOperation) (task *Task, err error)

Change a service version to the specified image by destroying and recreating the VMs.

func (*ServicesAPI) Delete

func (api *ServicesAPI) Delete(id string) (task *Task, err error)

Deletes a service with specified ID.

func (*ServicesAPI) Get

func (api *ServicesAPI) Get(id string) (service *Service, err error)

Gets a service with the specified ID.

func (*ServicesAPI) GetVMs

func (api *ServicesAPI) GetVMs(id string) (result *VMs, err error)

Gets vms for service with the specified ID.

func (*ServicesAPI) Resize

func (api *ServicesAPI) Resize(id string, resize *ServiceResizeOperation) (task *Task, err error)

Resize a service to specified count.

func (*ServicesAPI) TriggerMaintenance

func (api *ServicesAPI) TriggerMaintenance(id string) (task *Task, err error)

Start a background process to recreate failed VMs in a service with the specified ID.

type StatsInfo

type StatsInfo struct {
	Enabled       bool   `json:"enabled,omitempty"`
	StoreEndpoint string `json:"storeEndpoint,omitempty"`
	StorePort     int    `json:"storePort,omitempty"`
}

Represents stats information

type Status

type Status struct {
	Status     string
	Components []Component
}

Represents status of the photon system.

type Step

type Step struct {
	ID                 string                 `json:"id"`
	Operation          string                 `json:"operation,omitempty"`
	State              string                 `json:"state"`
	StartedTime        int64                  `json:"startedTime"`
	EndTime            int64                  `json:"endTime,omitempty"`
	QueuedTime         int64                  `json:"queuedTime"`
	Sequence           int                    `json:"sequence,omitempty"`
	ResourceProperties map[string]interface{} `json:"resourceProperties,omitempty"`
	Errors             []ApiError             `json:"errors,omitempty"`
	Warnings           []ApiError             `json:"warnings,omitempty"`
	Options            map[string]interface{} `json:"options,omitempty"`
	SelfLink           string                 `json:"selfLink,omitempty"`
}

Represents an operation (Step) within a Task.

type Subnet

type Subnet struct {
	ID                 string            `json:"id"`
	Kind               string            `json:"kind"`
	Name               string            `json:"name"`
	Description        string            `json:"description,omitempty"`
	PrivateIpCidr      string            `json:"privateIpCidr"`
	ReservedIps        map[string]string `json:"reservedIps"`
	State              string            `json:"state"`
	IsDefault          bool              `json:"isDefault"`
	PortGroups         PortGroups        `json:"portGroups"`
	DnsServerAddresses []string          `json:"dnsServerAddresses"`
}

Represents a subnet

type SubnetCreateSpec

type SubnetCreateSpec struct {
	Name               string     `json:"name"`
	Description        string     `json:"description"`
	PrivateIpCidr      string     `json:"privateIpCidr"`
	Type               string     `json:"type"`
	PortGroups         PortGroups `json:"portGroups"`
	DnsServerAddresses []string   `json:"dnsServerAddresses"`
}

Creation spec for subnets.

type SubnetGetOptions

type SubnetGetOptions struct {
	Name string `urlParam:"name"`
}

Options for GetSubnets API.

type SubnetUpdateSpec

type SubnetUpdateSpec struct {
	SubnetName string `json:"name"`
}

Represents name that can be set for subnet

type Subnets

type Subnets struct {
	Items []Subnet `json:"items"`
}

Represents multiple subnets returned by the API.

type SubnetsAPI

type SubnetsAPI struct {
	// contains filtered or unexported fields
}

Contains functionality for subnets API.

func (*SubnetsAPI) Create

func (api *SubnetsAPI) Create(subnetSpec *SubnetCreateSpec) (task *Task, err error)

Creates a portgroup.

func (*SubnetsAPI) Delete

func (api *SubnetsAPI) Delete(id string) (task *Task, err error)

Deletes a subnet with the specified ID.

func (*SubnetsAPI) Get

func (api *SubnetsAPI) Get(id string) (subnet *Subnet, err error)

Gets a subnet with the specified ID.

func (*SubnetsAPI) GetAll

func (api *SubnetsAPI) GetAll(options *SubnetGetOptions) (result *Subnets, err error)

Returns all subnets

func (*SubnetsAPI) SetDefault

func (api *SubnetsAPI) SetDefault(id string) (task *Task, err error)

Sets default subnet.

func (*SubnetsAPI) Update

func (api *SubnetsAPI) Update(id string, subnetSpec *SubnetUpdateSpec) (task *Task, err error)

Updates subnet's attributes.

type SystemAPI

type SystemAPI struct {
	// contains filtered or unexported fields
}

Contains functionality for system API.

func (*SystemAPI) ConfigureNsx

func (api *SystemAPI) ConfigureNsx(nsxConfigSpec *NsxConfigurationSpec) (task *Task, err error)

Configure NSX.

func (*SystemAPI) DisableServiceType

func (api *SystemAPI) DisableServiceType(serviceConfigSpec *ServiceConfigurationSpec) (task *Task, err error)

Disable service type

func (*SystemAPI) EnableServiceType

func (api *SystemAPI) EnableServiceType(serviceConfigSpec *ServiceConfigurationSpec) (task *Task, err error)

Enable service type

func (*SystemAPI) GetAuthInfo

func (api *SystemAPI) GetAuthInfo() (info *AuthInfo, err error)

Gets authentication info.

func (*SystemAPI) GetSystemInfo

func (api *SystemAPI) GetSystemInfo() (systemInfo *SystemInfo, err error)

Gets the system info.

func (*SystemAPI) GetSystemSize

func (api *SystemAPI) GetSystemSize() (deploymentSize *SystemUsage, err error)

Gets the system info.

func (*SystemAPI) GetSystemStatus

func (api *SystemAPI) GetSystemStatus() (status *Status, err error)

Get status of photon controller

func (*SystemAPI) GetSystemVms

func (api *SystemAPI) GetSystemVms() (result *VMs, err error)

Gets all the system vms

func (*SystemAPI) PauseBackgroundTasks

func (api *SystemAPI) PauseBackgroundTasks() (task *Task, err error)

Pause system background tasks.

func (*SystemAPI) PauseSystem

func (api *SystemAPI) PauseSystem() (task *Task, err error)

Pause system.

func (*SystemAPI) ResumeSystem

func (api *SystemAPI) ResumeSystem() (task *Task, err error)

Resume system.

func (*SystemAPI) SetSecurityGroups

func (api *SystemAPI) SetSecurityGroups(securityGroups *SecurityGroupsSpec) (task *Task, err error)

Sets security groups for the system

type SystemInfo

type SystemInfo struct {
	NTPEndpoint             string                 `json:"ntpEndpoint,omitempty"`
	UseImageDatastoreForVms bool                   `json:"useImageDatastoreForVms,omitempty"`
	Auth                    *AuthInfo              `json:"auth"`
	NetworkConfiguration    *NetworkConfiguration  `json:"networkConfiguration"`
	Kind                    string                 `json:"kind"`
	SyslogEndpoint          string                 `json:"syslogEndpoint,omitempty"`
	Stats                   *StatsInfo             `json:"stats,omitempty"`
	State                   string                 `json:"state"`
	ImageDatastores         []string               `json:"imageDatastores"`
	ServiceConfigurations   []ServiceConfiguration `json:"serviceConfigurations,omitempty"`
	LoadBalancerEnabled     bool                   `json:"loadBalancerEnabled"`
	LoadBalancerAddress     string                 `json:"loadBalancerAddress"`
	BaseVersion             string                 `json:"baseVersion"`
	FullVersion             string                 `json:"fullVersion"`
	GitCommitHash           string                 `json:"gitCommitHash"`
	NetworkType             string                 `json:"networkType"`
}

type SystemUsage

type SystemUsage struct {
	NumberHosts      int `json:"numberHosts"`
	NumberVMs        int `json:"numberVMs"`
	NumberTenants    int `json:"numberTenants"`
	NumberProjects   int `json:"numberProjects"`
	NumberDatastores int `json:"numberDatastores"`
	NumberServices   int `json:"numberServices"`
}

type Task

type Task struct {
	ID                 string      `json:"id"`
	Operation          string      `json:"operation,omitempty"`
	State              string      `json:"state"`
	StartedTime        int64       `json:"startedTime"`
	EndTime            int64       `json:"endTime,omitempty"`
	QueuedTime         int64       `json:"queuedTime"`
	Entity             Entity      `json:"entity,omitempty"`
	SelfLink           string      `json:"selfLink,omitempty"`
	Steps              []Step      `json:"steps,omitempty"`
	ResourceProperties interface{} `json:"resourceProperties,omitempty"`
}

Represents an asynchronous task.

type TaskError

type TaskError struct {
	ID   string `json:"id"`
	Step Step   `json:"step,omitempty"`
}

Represents an Photon task that has entered into an error state. Photon task errors can be caught and type-checked against with the usual Go idiom.

func (TaskError) Error

func (e TaskError) Error() string

Implement Go error interface for TaskError.

type TaskGetOptions

type TaskGetOptions struct {
	State      string `urlParam:"state"`
	Kind       string `urlParam:"kind"`
	EntityID   string `urlParam:"entityId"`
	EntityKind string `urlParam:"entityKind"`
}

Options for GetTasks API.

type TaskList

type TaskList struct {
	Items []Task `json:"items"`
}

Represents multiple tasks returned by the API.

type TaskTimeoutError

type TaskTimeoutError struct {
	ID string
}

An error representing a timeout while waiting for a task to complete.

func (TaskTimeoutError) Error

func (e TaskTimeoutError) Error() string

Implement Go error interface for TaskTimeoutError.

type TasksAPI

type TasksAPI struct {
	// contains filtered or unexported fields
}

Contains functionality for tasks API.

func (*TasksAPI) Get

func (api *TasksAPI) Get(id string) (task *Task, err error)

Gets a task by ID.

func (*TasksAPI) GetAll

func (api *TasksAPI) GetAll(options *TaskGetOptions) (result *TaskList, err error)

Gets all tasks, using options to filter the results. If options is nil, no filtering will occur.

func (*TasksAPI) Wait

func (api *TasksAPI) Wait(id string) (task *Task, err error)

Waits for a task to complete by polling the tasks API until a task returns with the state COMPLETED or ERROR.

func (*TasksAPI) WaitTimeout

func (api *TasksAPI) WaitTimeout(id string, timeout time.Duration) (task *Task, err error)

Waits for a task to complete by polling the tasks API until a task returns with the state COMPLETED or ERROR. Will wait no longer than the duration specified by timeout.

type Tenant

type Tenant struct {
	Projects       []BaseCompact   `json:"projects"`
	Kind           string          `json:"kind"`
	Name           string          `json:"name"`
	ID             string          `json:"id"`
	SelfLink       string          `json:"selfLink"`
	Tags           []string        `json:"tags"`
	SecurityGroups []SecurityGroup `json:"securityGroups"`
	ResourceQuota  Quota           `json:"quota,omitempty"`
}

Represents a single tenant.

type TenantCreateSpec

type TenantCreateSpec struct {
	Name           string   `json:"name"`
	SecurityGroups []string `json:"securityGroups,omitempty"`
	ResourceQuota  Quota    `json:"quota,omitempty"`
}

Creation spec for tenants.

type Tenants

type Tenants struct {
	Items []Tenant `json:"items"`
}

Represents multiple tenants returned by the API.

type TenantsAPI

type TenantsAPI struct {
	// contains filtered or unexported fields
}

Contains functionality for tenants API.

func (*TenantsAPI) Create

func (api *TenantsAPI) Create(tenantSpec *TenantCreateSpec) (task *Task, err error)

Creates a tenant.

func (*TenantsAPI) CreateProject

func (api *TenantsAPI) CreateProject(tenantId string, spec *ProjectCreateSpec) (task *Task, err error)

Creates a project on the specified tenant.

func (*TenantsAPI) Delete

func (api *TenantsAPI) Delete(id string) (task *Task, err error)

Deletes the tenant with specified ID. Any projects, VMs, disks, etc., owned by the tenant must be deleted first.

func (*TenantsAPI) ExcludeQuota

func (api *TenantsAPI) ExcludeQuota(tenantId string, spec *QuotaSpec) (task *Task, err error)

Exclude project quota line items from the specific quota spec.

func (*TenantsAPI) Get

func (api *TenantsAPI) Get(identity string) (tenant *Tenant, err error)

Gets a tenant with the specified ID or name

func (*TenantsAPI) GetAll

func (api *TenantsAPI) GetAll() (result *Tenants, err error)

Returns all tenants on an photon instance.

func (*TenantsAPI) GetIam

func (api *TenantsAPI) GetIam(tenantId string) (policy []*RoleBinding, err error)

Gets IAM Policy of a tenant.

func (*TenantsAPI) GetProjects

func (api *TenantsAPI) GetProjects(tenantId string, options *ProjectGetOptions) (result *ProjectList, err error)

Gets the projects for tenant with the specified ID, using options to filter the results. If options is nil, no filtering will occur.

func (*TenantsAPI) GetQuota

func (api *TenantsAPI) GetQuota(tenantId string) (quota *Quota, err error)

Get quota for project with the specified ID.

func (*TenantsAPI) GetTasks

func (api *TenantsAPI) GetTasks(id string, options *TaskGetOptions) (result *TaskList, err error)

Gets all tasks with the specified tenant ID, using options to filter the results. If options is nil, no filtering will occur.

func (*TenantsAPI) ModifyIam

func (api *TenantsAPI) ModifyIam(tenantId string, policyDelta []*RoleBindingDelta) (task *Task, err error)

Modifies IAM Policy on a tenant.

func (*TenantsAPI) SetIam

func (api *TenantsAPI) SetIam(tenantId string, policy []*RoleBinding) (task *Task, err error)

Sets IAM Policy on a tenant.

func (*TenantsAPI) SetQuota

func (api *TenantsAPI) SetQuota(tenantId string, spec *QuotaSpec) (task *Task, err error)

Set (replace) the whole project quota with the quota line items specified in quota spec.

func (*TenantsAPI) SetSecurityGroups

func (api *TenantsAPI) SetSecurityGroups(id string, securityGroups *SecurityGroupsSpec) (*Task, error)

Set security groups for this tenant, overwriting any existing ones.

func (*TenantsAPI) UpdateQuota

func (api *TenantsAPI) UpdateQuota(tenantId string, spec *QuotaSpec) (task *Task, err error)

Update portion of the project quota with the quota line items specified in quota spec.

type TokenCallback

type TokenCallback func(string)

type TokenOptions

type TokenOptions struct {
	AccessToken  string `json:"access_token"`
	ExpiresIn    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token,omitempty"`
	IdToken      string `json:"id_token"`
	TokenType    string `json:"token_type"`
}

Represents Tokens

type VM

type VM struct {
	SourceImageID string            `json:"sourceImageId,omitempty"`
	Cost          []QuotaLineItem   `json:"cost"`
	Kind          string            `json:"kind"`
	AttachedDisks []AttachedDisk    `json:"attachedDisks"`
	Datastore     string            `json:"datastore,omitempty"`
	AttachedISOs  []ISO             `json:"attachedIsos,omitempty"`
	Tags          []string          `json:"tags,omitempty"`
	Metadata      map[string]string `json:"metadata,omitempty"`
	SelfLink      string            `json:"selfLink,omitempty"`
	Flavor        string            `json:"flavor"`
	Host          string            `json:"host,omitempty"`
	Name          string            `json:"name"`
	State         string            `json:"state"`
	ID            string            `json:"id"`
	FloatingIp    string            `json:"floatingIp"`
}

Represents a single VM.

type VMs

type VMs struct {
	Items []VM `json:"items"`
}

Represents multiple VMs returned by the API.

type VmAPI

type VmAPI struct {
	// contains filtered or unexported fields
}

Contains functionality for VMs API.

func (*VmAPI) AcquireFloatingIp

func (api *VmAPI) AcquireFloatingIp(id string, spec *VmFloatingIpSpec) (task *Task, err error)

func (*VmAPI) AttachDisk

func (api *VmAPI) AttachDisk(id string, op *VmDiskOperation) (task *Task, err error)

func (*VmAPI) AttachISO

func (api *VmAPI) AttachISO(id string, reader io.ReadSeeker, name string) (task *Task, err error)

func (*VmAPI) CreateImage

func (api *VmAPI) CreateImage(id string, options *ImageCreateSpec) (task *Task, err error)

func (*VmAPI) Delete

func (api *VmAPI) Delete(id string) (task *Task, err error)

func (*VmAPI) DetachDisk

func (api *VmAPI) DetachDisk(id string, op *VmDiskOperation) (task *Task, err error)

func (*VmAPI) DetachISO

func (api *VmAPI) DetachISO(id string) (task *Task, err error)

func (*VmAPI) Get

func (api *VmAPI) Get(id string) (vm *VM, err error)

func (*VmAPI) GetIam

func (api *VmAPI) GetIam(id string) (policy []*RoleBinding, err error)

Gets IAM Policy on a VM.

func (*VmAPI) GetMKSTicket

func (api *VmAPI) GetMKSTicket(id string) (task *Task, err error)

func (*VmAPI) GetNetworks

func (api *VmAPI) GetNetworks(id string) (task *Task, err error)

func (*VmAPI) GetTasks

func (api *VmAPI) GetTasks(id string, options *TaskGetOptions) (result *TaskList, err error)

Gets all tasks with the specified vm ID, using options to filter the results. If options is nil, no filtering will occur.

func (*VmAPI) ModifyIam

func (api *VmAPI) ModifyIam(id string, policyDelta []*RoleBindingDelta) (task *Task, err error)

Modifies IAM Policy on a VM.

func (*VmAPI) ReleaseFloatingIp

func (api *VmAPI) ReleaseFloatingIp(id string) (task *Task, err error)

func (*VmAPI) Restart

func (api *VmAPI) Restart(id string) (task *Task, err error)

func (*VmAPI) Resume

func (api *VmAPI) Resume(id string) (task *Task, err error)

func (*VmAPI) SetIam

func (api *VmAPI) SetIam(id string, policy []*RoleBinding) (task *Task, err error)

Sets IAM Policy on a VM.

func (*VmAPI) SetMetadata

func (api *VmAPI) SetMetadata(id string, metadata *VmMetadata) (task *Task, err error)

func (*VmAPI) SetTag

func (api *VmAPI) SetTag(id string, tag *VmTag) (task *Task, err error)

func (*VmAPI) Start

func (api *VmAPI) Start(id string) (task *Task, err error)

func (*VmAPI) Stop

func (api *VmAPI) Stop(id string) (task *Task, err error)

func (*VmAPI) Suspend

func (api *VmAPI) Suspend(id string) (task *Task, err error)

type VmCreateSpec

type VmCreateSpec struct {
	Flavor        string            `json:"flavor"`
	SourceImageID string            `json:"sourceImageId"`
	AttachedDisks []AttachedDisk    `json:"attachedDisks"`
	Affinities    []LocalitySpec    `json:"affinities,omitempty"`
	Name          string            `json:"name"`
	Tags          []string          `json:"tags,omitempty"`
	Subnets       []string          `json:"subnets,omitempty"`
	Environment   map[string]string `json:"environment,omitempty"`
}

Creation spec for VMs.

type VmDiskOperation

type VmDiskOperation struct {
	DiskID    string                 `json:"diskId"`
	Arguments map[string]interface{} `json:"arguments,omitempty"`
}

Represents operations for disks.

type VmFloatingIpSpec

type VmFloatingIpSpec struct {
	NetworkId string `json:"networkId"`
}

Represents a floating IP operation related to a VM.

type VmGetOptions

type VmGetOptions struct {
	Name string `urlParam:"name"`
}

Options for GetDisks API.

type VmMetadata

type VmMetadata struct {
	Metadata map[string]string `json:"metadata"`
}

Represents metadata that can be set on a VM.

type VmOperation

type VmOperation struct {
	Operation string                 `json:"operation"`
	Arguments map[string]interface{} `json:"arguments,omitempty"`
}

Represents possible operations for VMs. Valid values include: START_VM, STOP_VM, RESTART_VM, SUSPEND_VM, RESUME_VM

type VmTag

type VmTag struct {
	Tag string `json:"value"`
}

Represents tags that can be set on a VM.

type Zone

type Zone struct {
	Kind     string `json:"kind"`
	Name     string `json:"name"`
	State    string `json:"state"`
	ID       string `json:"id"`
	SelfLink string `json:"selfLink"`
}

Represents single zone.

type ZoneCreateSpec

type ZoneCreateSpec struct {
	Name string `json:"name"`
}

Creation spec for zones.

type Zones

type Zones struct {
	Items []Zone `json:"items"`
}

Represents multiple zones returned by the API.

type ZonesAPI

type ZonesAPI struct {
	// contains filtered or unexported fields
}

Contains functionality for zones API.

func (*ZonesAPI) Create

func (api *ZonesAPI) Create(zoneSpec *ZoneCreateSpec) (task *Task, err error)

Creates zone.

func (*ZonesAPI) Delete

func (api *ZonesAPI) Delete(id string) (task *Task, err error)

Deletes the zone with specified ID.

func (*ZonesAPI) Get

func (api *ZonesAPI) Get(id string) (zone *Zone, err error)

Gets zone with the specified ID.

func (*ZonesAPI) GetAll

func (api *ZonesAPI) GetAll() (result *Zones, err error)

Returns all zones on an photon instance.

func (*ZonesAPI) GetTasks

func (api *ZonesAPI) GetTasks(id string, options *TaskGetOptions) (result *TaskList, err error)

Gets all tasks with the specified zone ID, using options to filter the results. If options is nil, no filtering will occur.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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