onesphere

package module
v0.0.0-...-6fc1cce Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2019 License: MIT Imports: 11 Imported by: 1

README

Go bindings for HPE OneSphere APIs

Prerequisites

go1.9.2 and above. You can install the latest version from:

https://golang.org/dl

Usage

Install the OneSphere package
go get github.com/HewlettPackard/hpe-onesphere-go
Import the package
import (
  "fmt"
  "github.com/HewlettPackard/hpe-onesphere-go"
)
Connect to the OneSphere server
osClient, err := onesphere.Connect("https://onesphere-host-url", "username", "password")
Make calls to the OneSphere API
fmt.Println("Status:", osClient.GetStatus())

example output

{"service":"OK","database":""}
Disconnect from the OneSphere server
osClient.Disconnect()

Full Example

see sample/main.go

Run the sample project

go get the OneSphere project

go get github.com/HewlettPackard/hpe-onesphere-go

You must set the OneSphere host url, user, and password flags.

Replace these values:

  • ONESPHERE_HOST_URL
  • YOUR_ONESPHERE_USERNAME
  • YOUR_ONESPHERE_PASSWORD
go run $GOPATH/src/github.com/HewlettPackard/hpe-onesphere-go/sample/main.go \
  -host=https://ONESPHERE_HOST_URL \
  -user=YOUR_ONESPHERE_USERNAME \
  -password=YOUR_ONESPHERE_PASSWORD

alternatively use environment variables

host=https://ONESPHERE_HOST_URL \
  user=YOUR_ONESPHERE_USERNAME \
  password=YOUR_ONESPHERE_PASSWORD \
  go run $GOPATH/src/github.com/HewlettPackard/hpe-onesphere-go/sample/main.go

Run the tests

http requests are not mocked, a valid OneSphere account is required to pass tests

go get the OneSphere project

go get github.com/HewlettPackard/hpe-onesphere-go
go test github.com/HewlettPackard/hpe-onesphere-go \
  -host=https://ONESPHERE_HOST_URL \
  -user=YOUR_ONESPHERE_USERNAME \
  -password=YOUR_ONESPHERE_PASSWORD

or use environment variables

host=https://ONESPHERE_HOST_URL \
  user=YOUR_ONESPHERE_USERNAME \
  password=YOUR_ONESPHERE_PASSWORD \
  go test github.com/HewlettPackard/hpe-onesphere-go

APIs

All the APIs return data in JSON format the same as those returned from HPE OneSphere composable APIs.

Not Implemented Yet

Some APIs are not yet implemented.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	URI    string `json:"uri"`
	Events []struct {
		NamedUriIdentifier
		ResourceUri string `json:"resourceUri"`
		UserId      string `json:"userId"`
		Created     string `json:"created"`
		Modified    string `json:"modified"`
	} `json:"events"`
	Metrics []struct {
		Associations []struct {
			NamedUri
			Category string `json:"category"`
		} `json:"associations"`
		Count       string    `json:"count"`
		Description string    `json:"description"`
		Name        string    `json:"name"`
		Resource    *Resource `json:"resource"`
		ResourceUri string    `json:"resourceUri"`
		Start       int       `json:"start"`
		Total       int       `json:"total"`
		Units       string    `json:"units"`
		Values      []struct {
			End   string `json:"end"`
			Start string `json:"start"`
			Value string `json:"value"`
		} `json:"values"`
	} `json:"metrics"`
	Created  string `json:"created"`
	Modified string `json:"modified"`
}

type AddressWithType

type AddressWithType struct {
	Address     string `json:"address"`
	AddressType string `json:"addressType"`
}

AddressWithType defines JSON struct for { address, addressType }

type Appliance

type Appliance struct {
	ID         string             `json:"id"`
	Name       string             `json:"name"`
	URI        string             `json:"uri"`
	Endpoint   *ApplianceEndpoint `json:"endpoint"`
	L2Networks []struct {
		EthernetNetworkType string `json:"ethernetNetworkType"`
		Name                string `json:"name"`
		Purpose             string `json:"purpose"`
		URI                 string `json:"uri"`
		VlanID              string `json:"vlanId"`
	} `json:"l2networks"`
	RegionUri string `json:"regionUri"`
	State     string `json:"state"`
	Status    string `json:"status"`
	Type      string `json:"type"`
	Created   string `json:"created"`
	Modified  string `json:"modified"`
}

type ApplianceEndpoint

type ApplianceEndpoint struct {
	Address  string `json:"address"`
	Password string `json:"password"`
	Username string `json:"username"`
}

type ApplianceList

type ApplianceList struct {
	Total   int         `json:"total"`
	Members []Appliance `json:"members"`
}

type ApplianceRequest

type ApplianceRequest struct {
	Name      string             `json:"name"`
	Endpoint  *ApplianceEndpoint `json:"endpoint"`
	RegionURI string             `json:"regionUri"`
	Type      string             `json:"type"`
}

type Auth

type Auth struct {
	Token   string
	HostURL string
}

Auth contains the Token and HostURL of the OneSphere API connection

type Catalog

type Catalog struct {
	ID               string    `json:"id"`
	Name             string    `json:"name"`
	URI              string    `json:"uri"`
	Created          time.Time `json:"created"`
	Modified         time.Time `json:"modified"`
	Status           string    `json:"status"`
	URL              string    `json:"url"`
	ServiceTypeURI   string    `json:"serviceTypeUri"`
	CatalogTypeURI   string    `json:"catalogTypeUri"`
	ServicesCount    int       `json:"servicesCount"`
	State            string    `json:"state"`
	Protected        bool      `json:"protected"`
	Message          string    `json:"message"`
	SupportedActions []string  `json:"supportedActions"`
}

type CatalogActionResponse

type CatalogActionResponse struct {
	Action string `json:"action"`
}

type CatalogList

type CatalogList struct {
	Total   int       `json:"total"`
	Members []Catalog `json:"members"`
}

type CatalogRequest

type CatalogRequest struct {
	Name           string `json:"name"`
	URL            string `json:"url"`
	CatalogTypeURI string `json:"catalogTypeUri"`
	Username       string `json:"username"`
	Password       string `json:"password"`
	AccessKey      string `json:"accessKey"`
	SecretKey      string `json:"secretKey"`
	ZoneURI        string `json:"zoneUri"`
}

type CatalogType

type CatalogType struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	URI         string `json:"uri"`
	CanUseZones bool   `json:"canUseZones"`
}

type CatalogTypeList

type CatalogTypeList struct {
	Total   int           `json:"total"`
	Members []CatalogType `json:"members"`
}

type Client

type Client struct {
	Auth *Auth
}

Client contains all the methods needed to interact with the OneSphere API use Connect() to return a *Client

func Connect

func Connect(hostURL, user, password string) (*Client, error)

Connect provides an interface to make calls to the OneSphere API

func (*Client) ActionCatalog

func (c *Client) ActionCatalog(catalog Catalog, actionType string) error

ActionCatalog Perform an Action on Catalog example actionType: "refresh"

func (*Client) ActionDeployment

func (c *Client) ActionDeployment(deployment Deployment, actionType string, force bool) error

ActionDeployment Perform an Action on Deployment example actionType: "restart"

func (*Client) ActionZone

func (c *Client) ActionZone(zoneId string, action ZoneAction) error
ActionZone Perform an Action on Zone

allowed ZoneAction.Type: reset | add-capacity | reduce-capacity allowed ZoneAction.ResourceOps.ResourceType: compute | storage

example ZoneAction:

ZoneAction{
	Type: "add-capacity",
	ResourceOps: &ResourceOps{
		ResourceType:     "compute",
		ResourceCapacity: 2,
	},
}

func (*Client) ChangePassword

func (c *Client) ChangePassword(password, token string) (string, error)

func (*Client) CreateAppliance

func (c *Client) CreateAppliance(applianceRequest ApplianceRequest) (Appliance, error)

CreateAppliance Creates Appliance and returns updated appliance

func (*Client) CreateBillingAccount

func (c *Client) CreateBillingAccount(apiAccessKey, description, directoryUri, enrollmentNumber, name, providerTypeUri string) (string, error)

func (*Client) CreateCatalog

func (c *Client) CreateCatalog(catalogRequest CatalogRequest) (Catalog, error)
CreateCatalog Creates Catalog and returns updated Catalog

use GetCatalogTypes() for CatalogTypeURI

CatalogTypeURI should be one of: - /rest/catalog-types/aws-az - /rest/catalog-types/vcenter - /rest/catalog-types/kvm - /rest/catalog-types/helm-charts-repository - /rest/catalog-types/docker-hub - /rest/catalog-types/docker-registry - /rest/catalog-types/docker-trusted-registry - /rest/catalog-types/private-docker-registry - /rest/catalog-types/amazon-ecr - /rest/catalog-types/azure-container-registry - /rest/catalog-types/hpe-managed

func (*Client) CreateDeployment

func (c *Client) CreateDeployment(deploymentRequest DeploymentRequest) (Deployment, error)

CreateDeployment Creates Deployment and returns updated deployment

func (*Client) CreateMembership

func (c *Client) CreateMembership(membershipRequest MembershipRequest) (Membership, error)

CreateMembership Creates Membership and returns updated Membership

func (*Client) CreateProject

func (c *Client) CreateProject(projectRequest ProjectRequest) (Project, error)

CreateProject Creates Project and returns updated Project

func (*Client) CreateProvider

func (c *Client) CreateProvider(providerRequest ProviderRequest) (Provider, error)

CreateProvider Creates a new Master provider or Member provider and returns updated Provider use GetProviderTypes() for ProviderTypeURI

func (*Client) CreateRegion

func (c *Client) CreateRegion(regionRequest RegionRequest) (Region, error)

CreateRegion Creates Region and returns updated Region

func (*Client) CreateRegionConnection

func (c *Client) CreateRegionConnection(regionId string, regionConnectionRequest RegionConnectionRequest) (RegionConnection, error)

CreateRegionConnection Creates RegionConnection and returns updated RegionConnection

func (*Client) CreateServer

func (c *Client) CreateServer(server *Server) (string, error)

func (*Client) CreateTag

func (c *Client) CreateTag(tagRequest TagRequest) (Tag, error)

CreateTag Creates Tag and returns updated Tag

func (*Client) CreateTagKey

func (c *Client) CreateTagKey(tagKeyRequest TagKeyRequest) (TagKey, error)

CreateTagKey Creates TagKey and returns updated TagKey

func (*Client) CreateUser

func (c *Client) CreateUser(userRequest UserRequest) (User, error)

CreateUser Creates User and returns updated User

func (*Client) CreateVolume

func (c *Client) CreateVolume(name string, sizeGiB int, zoneUri, projectUri string) (string, error)

func (*Client) CreateZone

func (c *Client) CreateZone(zoneRequest ZoneRequest) (Zone, error)

CreateZone Creates Zone and returns updated zone

func (*Client) CreateZoneConnection

func (c *Client) CreateZoneConnection(id string, connectionRequest ConnectionRequest) (Connection, error)

CreateZoneConnection Creates Connection and returns updated connection

func (*Client) DeleteAppliance

func (c *Client) DeleteAppliance(applianceId string) error

DeleteAppliance Deletes Appliance

func (*Client) DeleteBillingAccount

func (c *Client) DeleteBillingAccount(id string) (string, error)

func (*Client) DeleteCatalog

func (c *Client) DeleteCatalog(catalogId string) error

DeleteCatalog Deletes Catalog

func (*Client) DeleteDeployment

func (c *Client) DeleteDeployment(deploymentId string) error

DeleteDeployment Deletes Deployment

func (*Client) DeleteMembershipByID

func (c *Client) DeleteMembershipByID(membershipId string) error

DeleteMembershipByID Deletes Membership by ID

func (*Client) DeleteProject

func (c *Client) DeleteProject(projectId string) error

DeleteProject Deletes Project

func (*Client) DeleteProvider

func (c *Client) DeleteProvider(providerId string) error

DeleteProvider Deletes Provider

func (*Client) DeleteRegion

func (c *Client) DeleteRegion(regionId string) error

DeleteRegion Deletes Region

func (*Client) DeleteRegionConnection

func (c *Client) DeleteRegionConnection(regionId string) error

DeleteRegionConnection Deletes RegionConnection

func (*Client) DeleteServer

func (c *Client) DeleteServer(serverID string, force bool) (string, error)

func (*Client) DeleteTag

func (c *Client) DeleteTag(tagId string) error

DeleteTag Deletes Tag

func (*Client) DeleteTagKey

func (c *Client) DeleteTagKey(tagKeyId string) error

DeleteTagKey Deletes TagKey

func (*Client) DeleteUser

func (c *Client) DeleteUser(userId string) error

DeleteUser Deletes User

func (*Client) DeleteVolume

func (c *Client) DeleteVolume(volumeID string) (string, error)

func (*Client) DeleteZone

func (c *Client) DeleteZone(zoneId string) error

DeleteZone Deletes Zone

func (*Client) DeleteZoneConnection

func (c *Client) DeleteZoneConnection(zoneId, connectionUuid string) error

DeleteZoneConnection Deletes Zone Connection

func (*Client) Disconnect

func (c *Client) Disconnect()

func (*Client) GetAccount

func (c *Client) GetAccount(view string) (Account, error)

GetAccount returns global account information view : "full"

func (*Client) GetApplianceByID

func (c *Client) GetApplianceByID(id string) (Appliance, error)

GetApplianceByID returns an Appliance by id

func (*Client) GetAppliances

func (c *Client) GetAppliances() (ApplianceList, error)

GetAppliances returns a list of all Appliances

func (*Client) GetAppliancesByName

func (c *Client) GetAppliancesByName(name string) (ApplianceList, error)

GetAppliancesByName returns a list of all Appliances by name or names

func (*Client) GetAppliancesByNameAndRegion

func (c *Client) GetAppliancesByNameAndRegion(name string, regionUri string) (ApplianceList, error)

GetAppliancesByNameAndRegion returns a list of Appliances with optional name and regionUri name : "name of the desired appliance" regionUri : "set of appliances in this region"

func (*Client) GetAppliancesByRegion

func (c *Client) GetAppliancesByRegion(regionUri string) (ApplianceList, error)

GetAppliancesByName returns a list of all Appliances by name or names

func (*Client) GetAzureLoginProperties

func (c *Client) GetAzureLoginProperties() (string, error)

func (*Client) GetAzureProviderInfo

func (c *Client) GetAzureProviderInfo(directoryUri, location string) (string, error)

func (*Client) GetAzureSubscriptions

func (c *Client) GetAzureSubscriptions(directoryUri, location string) (string, error)

func (*Client) GetBillingAccount

func (c *Client) GetBillingAccount(id string) (string, error)

func (*Client) GetBillingAccounts

func (c *Client) GetBillingAccounts(query, view string) (string, error)

func (*Client) GetCatalogByID

func (c *Client) GetCatalogByID(id, view string) (Catalog, error)

GetCatalogByID returns an Catalog by id example view: "full"

func (*Client) GetCatalogTypes

func (c *Client) GetCatalogTypes() (CatalogTypeList, error)

GetCatalogTypes returns a list of all Catalog Types

func (*Client) GetCatalogs

func (c *Client) GetCatalogs(userQuery, view string) (CatalogList, error)

GetCatalogs with optional userQuery and view leave filter blank to get all catalogs example userQuery: "dock" example view: "full"

func (*Client) GetConnectApp

func (c *Client) GetConnectApp(os string) (string, error)

GetConnectApp allowed operating systems: ["windows", "mac"]

func (*Client) GetDeploymentByID

func (c *Client) GetDeploymentByID(id string) (Deployment, error)

GetDeploymentByID Retrieve Deployment by ID

func (*Client) GetDeploymentByName

func (c *Client) GetDeploymentByName(name string) (Deployment, error)

GetDeploymentByName returns first member of GetDeploymentsByName

func (*Client) GetDeploymentConsole

func (c *Client) GetDeploymentConsole(deployment Deployment) (string, error)

GetDeploymentConsole returns a Deployment console url

func (*Client) GetDeploymentKubeConfig

func (c *Client) GetDeploymentKubeConfig(deployment Deployment) (string, error)

GetDeploymentKubeConfig returns the kubeconfig of the deployment

func (*Client) GetDeployments

func (c *Client) GetDeployments(query string, userQuery string, sort string) (DeploymentList, error)

GetDeployments with optional userQuery and sort leave filter blank to get all deployments example query: "zoneUri EQ /rest/zones/xxxx" example userQuery: "ubuntu"

func (*Client) GetDeploymentsByName

func (c *Client) GetDeploymentsByName(name string) (DeploymentList, error)

func (*Client) GetEvents

func (c *Client) GetEvents(resourceUri string) (string, error)

func (*Client) GetKeyPair

func (c *Client) GetKeyPair(regionUri, projectUri string) (string, error)

func (*Client) GetMembershipByID

func (c *Client) GetMembershipByID(id string) (Membership, error)

GetMembershipByID returns a Membership by ID

func (*Client) GetMembershipRoleByName

func (c *Client) GetMembershipRoleByName(name string) (MembershipRole, error)

GetMembershipRoleByName returns a list of all MembershipRole filtered by name

func (*Client) GetMembershipRoles

func (c *Client) GetMembershipRoles() (MembershipRoleList, error)

GetMembershipRoles returns a list of all MembershipRoles

func (*Client) GetMemberships

func (c *Client) GetMemberships(query string) (MembershipList, error)

GetMemberships with optional query filter valid queries: projectUri, userUri, userGroupUri, roleUri leave query blank to get all memberships example query: "projectUri EQ e0300a831e2740a4aad680cd89115845" example query: "userUri EQ e0300a831e2740a4aad680cd89115845" example query: "roleUri EQ e0300a831e2740a4aad680cd89115845"

func (*Client) GetMembershipsByProject

func (c *Client) GetMembershipsByProject(projectUri string) (MembershipList, error)

GetMembershipByProject filters Memberships by projectUri

func (*Client) GetMembershipsByRole

func (c *Client) GetMembershipsByRole(roleUri string) (MembershipList, error)

GetMembershipByRole filters Memberships by roleUri

func (*Client) GetMembershipsByUser

func (c *Client) GetMembershipsByUser(userUri string) (MembershipList, error)

GetMembershipByUser filters Memberships by userUri

func (*Client) GetMembershipsByUserGroup

func (c *Client) GetMembershipsByUserGroup(userGroupUri string) (MembershipList, error)

GetMembershipByUserGroup filters Memberships by userGroupUri

func (*Client) GetMetrics

func (c *Client) GetMetrics(
	resourceUri, category, groupBy, query, name string,
	periodStart, period string,
	periodCount int,
	view string,
	start, count int) (string, error)

func (*Client) GetNetworkByID

func (c *Client) GetNetworkByID(id string) (Network, error)

GetNetworkByID returns an Network by id

func (*Client) GetNetworkByNameAndZoneURI

func (c *Client) GetNetworkByNameAndZoneURI(name, zoneUri string) (Network, error)

GetNetworkByNameAndZoneURI returns an Network by name and zoneUri

func (*Client) GetNetworkByZoneURI

func (c *Client) GetNetworkByZoneURI(zoneUri string) (Network, error)

GetNetworkByZoneURI returns an Network by zoneUri

func (*Client) GetNetworks

func (c *Client) GetNetworks(query string) (NetworkList, error)

GetNetworks with optional query leave query blank to get all networks example query: "zoneUri EQ /rest/zones/xxxx"

func (*Client) GetProjectByID

func (c *Client) GetProjectByID(id, view string) (Project, error)

GetProjectByID returns an Project by id example view: "full"

func (*Client) GetProjectByName

func (c *Client) GetProjectByName(name string) (Project, error)

GetProjectByName returns a Project by name

func (*Client) GetProjects

func (c *Client) GetProjects(userQuery, view string) (ProjectList, error)

GetProjects with optional userQuery leave userQuery blank to get all projects example userQuery: "zoneUri EQ /rest/zones/xxxx" example view: "full"

func (*Client) GetProviderByID

func (c *Client) GetProviderByID(id, view string, discover bool) (Provider, error)
GetProviderByID returns an Provider by id

example view: "full" discover: Will return the merged set of regions from AWS and existing regions in Onesphere.

func (*Client) GetProviderTypes

func (c *Client) GetProviderTypes() (ProviderTypeList, error)

GetProviderTypes returns a list of all Provider Types

func (*Client) GetProviders

func (c *Client) GetProviders(query string) (ProviderList, error)

GetProviders returns ProviderList with optional query AWS credentials are not included when listing providers. leave filter blank to get all providers example query: "providerTypeUri EQ /rest/provider-types/aws"

func (*Client) GetRate

func (c *Client) GetRate(rateID string) (string, error)

func (*Client) GetRates

func (c *Client) GetRates(resourceUri, effectiveForDate, effectiveDate, metricName string,
	active bool, start, count int) (string, error)

func (*Client) GetRegionByID

func (c *Client) GetRegionByID(id, view string, discover bool) (Region, error)

GetRegionByID returns a Provider by id example view: "full" discover: Will return child providers from aws.

func (*Client) GetRegionByName

func (c *Client) GetRegionByName(name string) (Region, error)

GetRegionByName Retrieve Region by Name

func (*Client) GetRegionConnection

func (c *Client) GetRegionConnection(regionId string) (RegionConnection, error)

func (*Client) GetRegionConnectorImage

func (c *Client) GetRegionConnectorImage(regionId string) (string, error)

GetRegionConnectorImage returns generated connector-image url

func (*Client) GetRegions

func (c *Client) GetRegions(query, view string) (RegionList, error)

GetRegions returns RegionList with optional query and view leave query blank to get all regions example query: "providerUri EQ /rest/providers/xxxx" example view: "full"

func (*Client) GetRoles

func (c *Client) GetRoles() (string, error)

func (*Client) GetServer

func (c *Client) GetServer(serverID string) (string, error)

func (*Client) GetServers

func (c *Client) GetServers(regionUri, applianceUri, zoneUri string) (string, error)

func (*Client) GetServiceByID

func (c *Client) GetServiceByID(id string) (Service, error)

GetServiceByID returns a Service by ID

func (*Client) GetServiceByName

func (c *Client) GetServiceByName(name string) (Service, error)

GetServiceByName returns a Service by Name

func (*Client) GetServiceTypeByID

func (c *Client) GetServiceTypeByID(id string) (ServiceType, error)

GetServiceTypeByID returns a Service Type by ID

func (*Client) GetServiceTypes

func (c *Client) GetServiceTypes() (ServiceTypeList, error)

GetServiceTypes returns a list of all Service Types

func (*Client) GetServices

func (c *Client) GetServices(query, userQuery string) (ServiceList, error)

GetServices returns a list of all Services with optional query and userQuery leave filter blank to get all services example query: "serviceTypeUri EQ /rest/service-types/zone" example userQuery: "kub"

func (*Client) GetSession

func (c *Client) GetSession(view string) (string, error)

view: "full"

func (*Client) GetSessionIdp

func (c *Client) GetSessionIdp(userName string) (string, error)

func (*Client) GetStatus

func (c *Client) GetStatus() (string, error)

GetStatus calls the /rest/status endpoint

func (*Client) GetTagByID

func (c *Client) GetTagByID(id, view string) (Tag, error)

GetTagByID returns an Tag by id example view: "full"

func (*Client) GetTagKeyByID

func (c *Client) GetTagKeyByID(id, view string) (TagKey, error)

GetTagKeyByID returns an TagKey by id example view: "full"

func (*Client) GetTagKeys

func (c *Client) GetTagKeys(view string) (TagKeyList, error)

GetTagKeys with optional view example view: "full"

func (*Client) GetTags

func (c *Client) GetTags(view string) (TagList, error)

GetTags with optional view example view: "full"

func (*Client) GetUserByID

func (c *Client) GetUserByID(id string) (User, error)

GetUserByID returns a User by id

func (*Client) GetUserByName

func (c *Client) GetUserByName(name string) (User, error)

GetUserByID returns a User by name

func (*Client) GetUsers

func (c *Client) GetUsers(userQuery string) (UserList, error)

GetUsers with optional userQuery leave userQuery blank to get all users example userQuery: "jon"

func (*Client) GetVersions

func (c *Client) GetVersions() (string, error)

func (*Client) GetVirtualMachineProfileByID

func (c *Client) GetVirtualMachineProfileByID(id string) (VirtualMachineProfile, error)

GetVirtualMachineProfileByID returns a VirtualMachineProfile by ID

func (*Client) GetVirtualMachineProfiles

func (c *Client) GetVirtualMachineProfiles(query string) (VirtualMachineProfileList, error)

GetVirtualMachineProfiles returns VirtualMachineProfileList with optional query for zoneUri and serviceUri leaving the query blank will return an empty VirtualMachineProfileList example query for serviceUri: "serviceUri EQ /rest/services/2F8bbc7abe-2ae1-a366-a4dd-f065618063a6" example query for zoneUri: "zoneUri EQ /rest/zones/b1d0b94b-b3e2-459f-95ed-a1b4d4645338" example query for both: "serviceUri EQ /rest/services/2F8bbc7abe-2ae1-a366-a4dd-f065618063a6 AND zoneUri EQ /rest/zones/b1d0b94b-b3e2-459f-95ed-a1b4d4645338"

func (*Client) GetVirtualMachineProfilesByServiceAndZoneURI

func (c *Client) GetVirtualMachineProfilesByServiceAndZoneURI(serviceURI, zoneURI string) (VirtualMachineProfileList, error)

GetVirtualMachineProfilesByServiceAndZoneURI returns VirtualMachineProfileList by zoneUri example: client.GetVirtualMachineProfilesByServiceAndZoneURI("/rest/services/2F8bbc7abe-2ae1-a366-a4dd-f065618063a6", "/rest/zones/b1d0b94b-b3e2-459f-95ed-a1b4d4645338")

func (*Client) GetVirtualMachineProfilesByServiceURI

func (c *Client) GetVirtualMachineProfilesByServiceURI(serviceURI string) (VirtualMachineProfileList, error)

GetVirtualMachineProfilesByServiceURI returns VirtualMachineProfileList by serviceUri example: client.GetVirtualMachineProfilesByServiceURI("/rest/services/2F8bbc7abe-2ae1-a366-a4dd-f065618063a6")

func (*Client) GetVirtualMachineProfilesByZoneURI

func (c *Client) GetVirtualMachineProfilesByZoneURI(zoneURI string) (VirtualMachineProfileList, error)

GetVirtualMachineProfilesByZoneURI returns VirtualMachineProfileList by zoneUri example: client.GetVirtualMachineProfilesByZoneURI("/rest/zones/b1d0b94b-b3e2-459f-95ed-a1b4d4645338")

func (*Client) GetVolume

func (c *Client) GetVolume(volumeID string) (string, error)

func (*Client) GetVolumes

func (c *Client) GetVolumes(query, view string) (string, error)

view: "full"

func (*Client) GetZoneApplianceImage

func (c *Client) GetZoneApplianceImage(id string) (string, error)

GetZoneApplianceImage Retrieve Zone Appliance Image URI by Zone.ID

func (*Client) GetZoneByID

func (c *Client) GetZoneByID(id string) (Zone, error)

GetZoneByID Retrieve Zone by ID

func (*Client) GetZoneByName

func (c *Client) GetZoneByName(name string) (Zone, error)

GetZoneByID Retrieve Zone by Name

func (*Client) GetZoneConnections

func (c *Client) GetZoneConnections(id, uuid string) (ConnectionList, error)

GetZoneConnections with optional uuid filter leave uuid blank to get all connections

func (*Client) GetZoneTaskStatus

func (c *Client) GetZoneTaskStatus(id string) (string, error)

GetZoneTaskStatus Retrieve Zone Appliance Image URI by Zone.ID

func (*Client) GetZoneTypeResourceProfiles

func (c *Client) GetZoneTypeResourceProfiles(zoneTypeId string) (ZoneTypeResourceProfileList, error)

GetZoneTypeResourceProfiles returns a ZoneTypeResourceProfileList

func (*Client) GetZoneTypes

func (c *Client) GetZoneTypes() (ZoneTypeList, error)

GetZoneTypes returns a list of all Zone Types

func (*Client) GetZones

func (c *Client) GetZones(query, regionUri, providerUri, applianceUri, view string) (ZoneList, error)
GetZones with optional query, and filters by regionUri, providerUri, applianceUri

leave query and filter blank to get all zones

query supports equality comparison against one or more properties using a "name EQ value" syntax. Multiple comparisons can be combined using a "name1 EQ value1 AND name2 EQ value2" syntax.

example query: "providerUri EQ /rest/providers/xxxx"

example view: "full"

func (*Client) ResetSingleUsePassword

func (c *Client) ResetSingleUsePassword(email string) (string, error)

func (*Client) RestAPICall

func (c *Client) RestAPICall(method rest.Method, path string, queryParams map[string]string, values interface{}) (string, error)

func (*Client) RestAPICallCustomHeaders

func (c *Client) RestAPICallCustomHeaders(method rest.Method, customHeaders map[string]string, path string, queryParams map[string]string, values interface{}) (string, error)

func (*Client) RestAPICallPatch

func (c *Client) RestAPICallPatch(path string, queryParams map[string]string, values interface{}) (string, error)

func (*Client) UpdateAppliance

func (c *Client) UpdateAppliance(applianceId string, updates []*PatchOp) (Appliance, error)

UpdateAppliance using []*PatchOp and returns updated appliance on success

func (*Client) UpdateAzureSubscription

func (c *Client) UpdateAzureSubscription(directoryUri, location, subscriptionId string, patchPayload []*PatchOp) (string, error)
 UpdateAzureSubscription allowed Ops in patchPayload:
  - add
	- replace

func (*Client) UpdateBillingAccount

func (c *Client) UpdateBillingAccount(id string, patchPayload []*PatchOp) (string, error)

UpdateBillingAccount sends PATCH with Op: "add|replace|remove"

func (*Client) UpdateCatalog

func (c *Client) UpdateCatalog(catalogId string, updates []*PatchOp) (Catalog, error)
UpdateCatalog using []*PatchOp returns updated catalog on success

Allowed fields for PATCH of catalogs

Path: /name Op: add | replace

Path: /password Op: add

Path: /accessKey Op: add

Path: /secretKey Op: add

Path: /state Op: add | replace

func (*Client) UpdateDeployment

func (c *Client) UpdateDeployment(deploymentId string, updates []*PatchOp) (Deployment, error)

UpdateDeployment using []*PatchOp returns updated deployment on success

func (*Client) UpdateNetwork

func (c *Client) UpdateNetwork(networkId string, updates []*PatchOp) (Network, error)
UpdateNetwork using []*PatchOp returns updated network on success

Allowed Ops for PATCH of networks: add | replace | remove

example:

Op: add Path: projectUris Value: /rest/projects/abc

func (*Client) UpdateProject

func (c *Client) UpdateProject(projectId string, updates ProjectRequest) (Project, error)

UpdateProject using ProjectRequest returns updated project on success

func (*Client) UpdateProvider

func (c *Client) UpdateProvider(providerId string, updates []*PatchOp) (Provider, error)
UpdateProvider using []*PatchOp returns updated provider on success

Allowed Ops for PATCH of providers: add | replace | remove

example:

Op: replace Path: /name Value: new name

func (*Client) UpdateRegion

func (c *Client) UpdateRegion(regionId string, updates []*PatchOp) (Region, error)
UpdateRegion using []*PatchOp returns updated region on success

UpdateRegion only supports provider type(/rest/provider-types/ncs).

Allowed fields for PATCH of NCS provider type: /name | /location Allowed OPs for PATCH of NCS provider type: add | replace

Path: /name Op: add

Path: /location Op: replace

func (*Client) UpdateServer

func (c *Client) UpdateServer(serverID string, patchPayload []*PatchOp) (string, error)
UpdateServer allowed Ops in patchPayload:

- replace - remove

func (*Client) UpdateUser

func (c *Client) UpdateUser(userId string, updates UserRequest) (User, error)

UpdateUser using UserRequest returns updated user on success

func (*Client) UpdateVolume

func (c *Client) UpdateVolume(volumeID, name string, sizeGiB int) (string, error)

func (*Client) UpdateZone

func (c *Client) UpdateZone(zoneId string, updates []*PatchOp) (Zone, error)
UpdateZone using []*PatchOp returns updated zone on success

Allowed Ops for PATCH of networks: add | replace | remove

example:

Op: "add" Path: "/inTransitClusters"

Value: []struct {
	ID    string `json:"id"`
	State string `json:"state"`
}{
	{
		ID: "domain-c51",
		State: "Enabled",
	},
}

example:

Op: "add" Path: "/networkSettings"

Value: struct {
	NcsManagementNetwork string   `json:"ncsManagementNetwork"`
	EsxManagementNetwork string   `json:"esxManagementNetwork"`
	StorageNetwork       string   `json:"storageNetwork"`
	MovementNetwork      string   `json:"movementNetwork"`
	ProductionNetwork    []string `json:"productionNetwork"`
} {
	NcsManagementNetwork: "net1",
	EsxManagementNetwork: "net2",
	StorageNetwork: "net3",
	MovementNetwork: "net4",
	ProductionNetwork: []string{ "net5", "net6" },
}

example:

Op: "add" Path: "/networkSettings"

Value: []struct {
	ServerURI string   `json:"serverUri"`
	State     string   `json:"state"`
	Roles     []string `json:"roles"`
}{
	{
		ServerURI: "/rest/servers/2b5a8db7-e145-4ef9-b7f2-9b2d45976cd3",
		State: "Enabled",
		Roles: []string{ "ImageLibrary" },
	},
}

func (*Client) UpdateZoneConnection

func (c *Client) UpdateZoneConnection(zoneId, connectionUuid string, updates []*PatchOp) (Connection, error)
UpdateZoneConnection using []*PatchOp returns updated Connection on success

Allowed Ops for PATCH of networks: add | replace | remove

type Cluster

type Cluster struct {
	Created    time.Time    `json:"created"`
	ID         string       `json:"id"`
	Name       string       `json:"name"`
	Modified   time.Time    `json:"modified"`
	Status     string       `json:"status"`
	State      string       `json:"state"`
	Error      *Error       `json:"error"`
	Hosts      []*Host      `json:"hosts"`
	Datastores []*Datastore `json:"datastores"`
}

type Connection

type Connection struct {
	ID       string `json:"id"`
	UUID     string `json:"uuid"`
	Name     string `json:"name"`
	Location struct {
		IPAddress string `json:"ipAddress"`
		Username  string `json:"username"`
		Password  string `json:"password"`
		Port      int    `json:"port"`
	} `json:"location"`
	State string `json:"state"`
	URI   string `json:"uri"`
}

type ConnectionList

type ConnectionList struct {
	Total   int          `json:"total"`
	Members []Connection `json:"members"`
}

type ConnectionRequest

type ConnectionRequest struct {
	UUID     string `json:"uuid"`
	Name     string `json:"name"`
	Location struct {
		IPAddress string `json:"ipAddress"`
		Username  string `json:"username"`
		Password  string `json:"password"`
		Port      int    `json:"port"`
	} `json:"location"`
	State string `json:"state"`
}

type Datastore

type Datastore struct {
	Created  time.Time `json:"created"`
	ID       string    `json:"id"`
	Name     string    `json:"name"`
	SizeGiB  float32   `json:"sizeGiB"`
	Type     string    `json:"type"`
	Modified time.Time `json:"modified"`
	Status   string    `json:"status"`
	State    string    `json:"state"`
	Error    *Error    `json:"error"`
}

type Deployment

type Deployment struct {
	ID                  string              `json:"id"`
	Name                string              `json:"name"`
	URI                 string              `json:"uri"`
	ZoneURI             string              `json:"zoneUri"`
	Zone                *NamedUriIdentifier `json:"zone"`
	RegionURI           string              `json:"regionUri"`
	ServiceURI          string              `json:"serviceUri"`
	Service             *NamedUriIdentifier `json:"service"`
	ServiceTypeURI      string              `json:"serviceTypeUri"`
	Version             string              `json:"version"`
	Status              string              `json:"status"`
	State               string              `json:"state"`
	ProjectURI          string              `json:"projectUri"`
	DeploymentEndpoints []*AddressWithType  `json:"deploymentEndpoints"`
	AppDeploymentInfo   string              `json:"appDeploymentInfo"`
	HasConsole          bool                `json:"hasConsole"`
	CloudPlatformID     string              `json:"cloudPlatformId"`
	Created             string              `json:"created"`
	Modified            string              `json:"modified"`
}

type DeploymentList

type DeploymentList struct {
	Total       int           `json:"total"`
	Count       int           `json:"count"`
	Start       int           `json:"start"`
	PrevPageURI utils.Nstring `json:"prevPageUri,omitempty"`
	NextPageURI utils.Nstring `json:"nextPageUri,omitempty"`
	URI         utils.Nstring `json:"uri,omitempty"`
	Members     []Deployment  `json:"members"`
}

deploymentList structure

type DeploymentNetworks

type DeploymentNetworks struct {
	NetworkURI string `json:"networkUri,omitempty"`
}

type DeploymentRequest

type DeploymentRequest struct {
	AssignExternalIP string `json:"assignExternalIP,omitempty"`
	Firewall         []struct {
		AllowedIPs string   `json:"allowedIPs"`
		Ports      []string `json:"ports"`
	} `json:"firewall"`
	HTTPProxy                string               `json:"httpProxy,omitempty"`
	HTTPProxyPassword        string               `json:"httpProxyPassword,omitempty"`
	HTTPProxyUserName        string               `json:"httpProxyUserName,omitempty"`
	Image                    string               `json:"image,omitempty"`
	K8SDeploymentRegion      string               `json:"k8sDeploymentRegion,omitempty"`
	K8SDomainURI             string               `json:"k8sDomainUri,omitempty"`
	K8SMasterFlavor          string               `json:"k8sMasterFlavor,omitempty"`
	K8SNumMasters            string               `json:"k8sNumMasters,omitempty"`
	K8SWorkerFlavor          string               `json:"k8sWorkerFlavor,omitempty"`
	K8SnumWorkers            string               `json:"k8snumWorkers,omitempty"`
	Name                     string               `json:"name,omitempty"`
	Networks                 []DeploymentNetworks `json:"networks,omitempty"`
	Parameters               string               `json:"parameters,omitempty"`
	ProjectURI               utils.Nstring        `json:"projectUri,omitempty"`
	PublicKey                string               `json:"publicKey,omitempty"`
	RegionURI                utils.Nstring        `json:"regionUri,omitempty"`
	ServiceInput             string               `json:"serviceInput,omitempty"`
	ServiceURI               utils.Nstring        `json:"serviceUri,omitempty"`
	UserData                 string               `json:"userData,omitempty"`
	Version                  string               `json:"version,omitempty"`
	VirtualMachineProfileURI utils.Nstring        `json:"virtualMachineProfileUri,omitempty"`
	ZoneURI                  string               `json:"zoneUri,omitempty"`
}

type Error

type Error struct {
	Message            string   `json:"message"`
	Details            string   `json:"details"`
	RecommendedActions []string `json:"recommendedActions"`
	NestedErrors       string   `json:"nestedErrors"`
	ErrorSource        string   `json:"errorSource"`
	ErrorCode          string   `json:"errorCode"`
	Data               string   `json:"data"`
	CanForce           bool     `json:"canForce"`
}

type Host

type Host struct {
	ID            string   `json:"id"`
	Name          string   `json:"name"`
	OsName        string   `json:"osName"`
	OsVersion     string   `json:"osVersion"`
	TotalMemoryGb float32  `json:"totalMemoryGb"`
	FreeMemoryGb  float32  `json:"freeMemoryGb"`
	TotalCPUGhz   float32  `json:"totalCpuGhz"`
	FreeCPUGhz    float32  `json:"freeCpuGhz"`
	Datastores    []string `json:"datastores"`
}

type KvmServer

type KvmServer struct {
	ServerURI  string       `json:"serverUri"`
	Name       string       `json:"name"`
	Created    time.Time    `json:"created"`
	Modified   time.Time    `json:"modified"`
	Status     string       `json:"status"`
	State      string       `json:"state"`
	Datastores []*Datastore `json:"datastores"`
	Host       *Host        `json:"host"`
	Roles      []string     `json:"roles"`
	Error      *Error       `json:"error"`
}

type Membership

type Membership struct {
	ID                string `json:"id"`
	GroupURI          string `json:"groupUri"`
	MembershipRoleURI string `json:"membershipRoleUri"`
	ProjectURI        string `json:"projectUri"`
	UserURI           string `json:"userUri"`
}

type MembershipList

type MembershipList struct {
	Total   int          `json:"total"`
	Members []Membership `json:"members"`
}

type MembershipRequest

type MembershipRequest = Membership

type MembershipRole

type MembershipRole = NamedUriIdentifier

type MembershipRoleList

type MembershipRoleList struct {
	Total   int              `json:"total"`
	Members []MembershipRole `json:"members"`
}

type Metric

type Metric struct {
	ResourceURI string    `json:"resourceUri"`
	Resource    *Resource `json:"resource"`
	Name        string    `json:"name"`
	Units       string    `json:"units"`
	Description string    `json:"description"`
	Values      []struct {
		Value int       `json:"value"`
		Start time.Time `json:"start"`
		End   time.Time `json:"end"`
	} `json:"values"`
	Total        int `json:"total"`
	Start        int `json:"start"`
	Count        int `json:"count"`
	Associations []struct {
		NamedUri
		Category string `json:"category"`
	} `json:"associations"`
}

type NamedUri

type NamedUri struct {
	Name string `json:"name"`
	URI  string `json:"uri"`
}

NamedUri defines JSON struct for { name, uri }

type NamedUriIdentifier

type NamedUriIdentifier struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	URI  string `json:"uri"`
}

NamedUriIdentifier defines JSON struct for { id, name, uri }

type Network

type Network struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	URI         string   `json:"uri"`
	Created     string   `json:"created"`
	IpamType    string   `json:"ipamType"`
	Modified    string   `json:"modified"`
	ProjectUris []string `json:"projectUris"`
	Shared      bool     `json:"shared"`
	Subnets     []struct {
		Cidr    string `json:"cidr"`
		DNS1    string `json:"dns1"`
		DNS2    string `json:"dns2"`
		Gateway string `json:"gateway"`
		IPPools []struct {
			EndIP   string `json:"endIP"`
			Purpose string `json:"purpose"`
			StartIP string `json:"startIP"`
		} `json:"ipPools"`
	} `json:"subnets"`
	Vlan    int    `json:"vlan"`
	ZoneURI string `json:"zoneUri"`
}

type NetworkList

type NetworkList struct {
	Total   int       `json:"total"`
	Members []Network `json:"members"`
}

type PatchOp

type PatchOp struct {
	Op    string      `json:"op"`
	Path  string      `json:"path"`
	Value interface{} `json:"value"`
}

type Project

type Project struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	URI         string `json:"uri"`
	Created     string `json:"created"`
	Deployments struct {
		Members []struct {
			NamedUriIdentifier
			ActiveUsers []struct {
				Email   string `json:"email"`
				IsLocal string `json:"isLocal"`
				Name    string `json:"name"`
				Role    string `json:"role"`
				URI     string `json:"uri"`
			} `json:"activeUsers"`
			ClusterURI string `json:"clusterUri"`
			CPUCount   int    `json:"cpuCount"`
			CPUGhz     int    `json:"cpuGhz"`
			Created    string `json:"created"`
			DiskSizeGB int    `json:"diskSizeGB"`
			Endpoints  []struct {
				AddressWithType
				Name string `json:"name"`
			} `json:"endpoints"`
			ErrorMessage string `json:"errorMessage"`
			Firewall     []struct {
				AllowedIPs string `json:"allowedIPs"`
				Ports      []int  `json:"ports"`
			} `json:"firewall"`
			HasConsole   bool                `json:"hasConsole"`
			MemorySizeGB int                 `json:"memorySizeGB"`
			Modified     string              `json:"modified"`
			ProjectURI   string              `json:"projectUri"`
			Region       *NamedUriIdentifier `json:"region"`
			RegionURI    string              `json:"regionUri"`
			Service      struct {
				NamedUriIdentifier
				Icon    string `json:"icon"`
				Version string `json:"version"`
			} `json:"service"`
			ServiceURI               string   `json:"serviceUri"`
			State                    string   `json:"state"`
			Status                   string   `json:"status"`
			VirtualMachineProfileURI string   `json:"virtualMachineProfileUri"`
			VolumeURIs               []string `json:"volumeURIs"`
			Volumes                  []struct {
				NamedUriIdentifier
				SizeGiB string `json:"sizeGiB"`
				Status  string `json:"status"`
			} `json:"volumes"`
			ZoneURI string `json:"zoneUri"`
		} `json:"members"`
		Total int `json:"total"`
	} `json:"deployments"`
	Modified  string   `json:"modified"`
	Protected bool     `json:"protected"`
	TagUris   []string `json:"tagUris"`
}

type ProjectList

type ProjectList struct {
	Total   int       `json:"total"`
	Members []Project `json:"members"`
}

type ProjectRequest

type ProjectRequest struct {
	Description string   `json:"description"`
	Name        string   `json:"name"`
	TagUris     []string `json:"tagUris"`
}

type Provider

type Provider struct {
	ID              string `json:"id"`
	Name            string `json:"name"`
	URI             string `json:"uri"`
	ProviderTypeURI string `json:"providerTypeUri"`
	Status          string `json:"status"`
	State           string `json:"state"`
	AccessKey       string `json:"accessKey"`
	SecretKey       string `json:"secretKey"`
	PaymentProvider bool   `json:"paymentProvider"`
	S3CostBucket    string `json:"s3CostBucket"`
	SubscriptionID  string `json:"subscriptionId"`
	DirectoryURI    string `json:"directoryUri"`
	TenantID        string `json:"tenantId"`
	UniqueName      string `json:"uniqueName"`
	FamilyName      string `json:"familyName"`
	GivenName       string `json:"givenName"`
	ClientID        string `json:"clientID"`
	ClientSecret    string `json:"clientSecret"`
	Children        []struct {
		ID              string `json:"id"`
		Name            string `json:"name"`
		URI             string `json:"uri"`
		ProviderTypeURI string `json:"providerTypeUri"`
		Status          string `json:"status"`
		State           string `json:"state"`
	} `json:"children"`
	BillingAccountURI string    `json:"billingAccountUri"`
	ProjectUris       []string  `json:"projectUris"`
	Regions           []*Region `json:"regions"`
	Metrics           []*Metric `json:"metrics"`
	Created           time.Time `json:"created"`
	Modified          time.Time `json:"modified"`
}

type ProviderList

type ProviderList struct {
	Total   int        `json:"total"`
	Members []Provider `json:"members"`
}

type ProviderRequest

type ProviderRequest struct {
	ID                string `json:"id"`
	ProviderTypeURI   string `json:"providerTypeUri"`
	AccessKey         string `json:"accessKey"`
	SecretKey         string `json:"secretKey"`
	PaymentProvider   bool   `json:"paymentProvider"`
	S3CostBucket      string `json:"s3CostBucket"`
	MasterURI         string `json:"masterUri"`
	SubscriptionID    string `json:"subscriptionId"`
	DirectoryURI      string `json:"directoryUri"`
	TenantID          string `json:"tenantId"`
	UniqueName        string `json:"uniqueName"`
	FamilyName        string `json:"familyName"`
	GivenName         string `json:"givenName"`
	BillingAccountURI string `json:"billingAccountUri"`
	State             string `json:"state"`
}

type ProviderType

type ProviderType struct {
	Created time.Time `json:"created"`
	ID      string    `json:"id"`
	Metrics []struct {
		ResourceURI string    `json:"resourceUri"`
		Resource    *Resource `json:"resource"`
		Name        string    `json:"name"`
		Units       string    `json:"units"`
		Description string    `json:"description"`
		Values      []struct {
			Value int       `json:"value"`
			Start time.Time `json:"start"`
			End   time.Time `json:"end"`
		} `json:"values"`
		Total        int `json:"total"`
		Start        int `json:"start"`
		Count        int `json:"count"`
		Associations []struct {
			Category string `json:"category"`
			Name     string `json:"name"`
			URI      string `json:"uri"`
		} `json:"associations"`
	} `json:"metrics"`
	Modified time.Time `json:"modified"`
	Name     string    `json:"name"`
	URI      string    `json:"uri"`
}

type ProviderTypeList

type ProviderTypeList struct {
	Total   int            `json:"total"`
	Members []ProviderType `json:"members"`
}

type Region

type Region struct {
	ID       string    `json:"id"`
	Metrics  []*Metric `json:"metrics"`
	Created  time.Time `json:"created"`
	Modified time.Time `json:"modified"`
	Name     string    `json:"name"`
	Location struct {
		Latitude  float32 `json:"latitude"`
		Longitude float32 `json:"longitude"`
	} `json:"location"`
	ProviderURI string    `json:"providerUri"`
	Provider    *Provider `json:"provider"`
	Zones       []*Zone   `json:"zones"`
	Status      string    `json:"status"`
	State       string    `json:"state"`
	URI         string    `json:"uri"`
}

type RegionConnection

type RegionConnection struct {
	EndpointUUID string `json:"endpointUuid"`
	Name         string `json:"name"`
	Location     struct {
		IPAddress string `json:"ipAddress"`
		Username  string `json:"username"`
		Password  string `json:"password"`
		Port      int    `json:"port"`
	} `json:"location"`
	State string `json:"state"`
	URI   string `json:"uri"`
}

type RegionConnectionRequest

type RegionConnectionRequest struct {
	EndpointUUID string `json:"endpointUuid"`
	Name         string `json:"name"`
	Location     struct {
		IPAddress string `json:"ipAddress"`
		Username  string `json:"username"`
		Password  string `json:"password"`
		Port      int    `json:"port"`
	} `json:"location"`
	State string `json:"state"`
}

type RegionList

type RegionList struct {
	Total   int      `json:"total"`
	Members []Region `json:"members"`
}

type RegionRequest

type RegionRequest struct {
	Location struct {
		Latitude  float32 `json:"latitude"`
		Longitude float32 `json:"longitude"`
	} `json:"location"`
	Name        string `json:"name"`
	ProviderURI string `json:"providerUri"`
}

type Resource

type Resource struct {
	NamedUri
	Value   string   `json:"value"`
	Project NamedUri `json:"project"`
	Zone    struct {
		NamedUri
		Region struct {
			NamedUri
			Provider struct {
				NamedUri
				ProviderType struct {
					Name string `json:"name"`
					Uri  string `json:"uri"`
				} `json:"providerType"`
			} `json:"provider"`
		} `json:"region"`
	} `json:"zone"`
}

type ResourceOps

type ResourceOps struct {
	ResourceType     string `json:"resourceType"`
	ResourceCapacity int    `json:"resourceCapacity"`
}

type Server

type Server struct {
	ApplianceUri   string `json:"applianceUri"`
	CoreCount      int    `json:"coreCount"`
	CoreSpeedMHz   int    `json:"coreSpeedMHz"`
	CpuModel       string `json:"cpuModel"`
	ExternalIds    []*ServerExternalId
	MemoryGB       int    `json:"memoryGB"`
	Name           string `json:"name"`
	ProcessorCount int    `json:"processorCount"`
	ProjectUri     string `json:"projectUri"`
	RegionUri      string `json:"regionUri"`
	ServerModel    string `json:"serverModel"`
	State          string `json:"state"` // "Enabling|Enabled|Disabling|Disabled"
	ZoneUri        string `json:"zoneUri"`
}

type ServerExternalId

type ServerExternalId struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

type Service

type Service = NamedUriIdentifier

type ServiceList

type ServiceList struct {
	Total   int       `json:"total"`
	Members []Service `json:"members"`
}

type ServiceType

type ServiceType = NamedUriIdentifier

type ServiceTypeList

type ServiceTypeList struct {
	Total   int           `json:"total"`
	Members []ServiceType `json:"members"`
}

type Tag

type Tag struct {
	ID        string  `json:"id"`
	Name      string  `json:"name"`
	TagKey    *TagKey `json:"tagKey"`
	TagKeyURI string  `json:"tagKeyUri"`
	URI       string  `json:"uri"`
}

type TagKey

type TagKey struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Tags []*Tag `json:"tags"`
	URI  string `json:"uri"`
}

type TagKeyList

type TagKeyList struct {
	Total   int      `json:"total"`
	Members []TagKey `json:"members"`
}

type TagKeyRequest

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

type TagList

type TagList struct {
	Total   int   `json:"total"`
	Members []Tag `json:"members"`
}

type TagRequest

type TagRequest struct {
	Name      string `json:"name"`
	TagKeyURI string `json:"tagKeyUri"`
}

type User

type User struct {
	ID      string `json:"id"`
	Email   string `json:"email"`
	Name    string `json:"name,omitempty"`
	URI     string `json:"uri"`
	Role    string `json:"role"`
	IsLocal bool   `json:"isLocal"`
}

type UserList

type UserList struct {
	Total   int    `json:"total"`
	Start   int    `json:"start"`
	Count   int    `json:"count"`
	Members []User `json:"members"`
}

type UserRequest

type UserRequest struct {
	Email    string `json:"email"`
	Name     string `json:"name"`
	Password string `json:"password"`
	Role     string `json:"role"`
}

type VirtualMachineProfile

type VirtualMachineProfile struct {
	ID           string    `json:"id"`
	Name         string    `json:"name"`
	URI          string    `json:"uri"`
	RegionURI    string    `json:"regionUri"`
	ZoneURI      string    `json:"zoneUri"`
	CPUCount     int       `json:"cpuCount"`
	MemorySizeGB int       `json:"memorySizeGB"`
	DiskSizeGB   int       `json:"diskSizeGB"`
	Created      time.Time `json:"created"`
	Modified     time.Time `json:"modified"`
}

type VirtualMachineProfileList

type VirtualMachineProfileList struct {
	ID           string    `json:"id"`
	Name         string    `json:"name"`
	URI          string    `json:"uri"`
	Description  string    `json:"description"`
	RegionURI    string    `json:"regionUri"`
	ZoneURI      string    `json:"zoneUri"`
	CPUCount     int       `json:"cpuCount"`
	MemorySizeGB int       `json:"memorySizeGB"`
	DiskSizeGB   int       `json:"diskSizeGB"`
	Created      time.Time `json:"created"`
	Modified     time.Time `json:"modified"`
}

type Zone

type Zone struct {
	Created      time.Time `json:"created"`
	ID           string    `json:"id"`
	Metrics      []*Metric `json:"metrics"`
	Modified     time.Time `json:"modified"`
	Name         string    `json:"name"`
	ProviderURI  string    `json:"providerUri"`
	RegionURI    string    `json:"regionUri"`
	Error        *Error    `json:"error"`
	Status       string    `json:"status"`
	State        string    `json:"state"`
	CurrentTasks []struct {
		TaskName   string `json:"taskName"`
		TaskState  string `json:"taskState"`
		TaskStatus string `json:"taskStatus"`
	} `json:"currentTasks"`
	Clusters          []*Cluster `json:"clusters"`
	InTransitClusters []*Cluster `json:"inTransitClusters"`
	EsxLcmTask        struct {
		URI             string   `json:"uri"`
		Name            string   `json:"name"`
		Type            string   `json:"type"`
		UUID            string   `json:"uuid"`
		ParentID        string   `json:"parentId"`
		ChildTasks      []string `json:"childTasks"`
		PercentComplete int      `json:"percentComplete"`
		ProgressUpdates []struct {
			StatusUpdate string    `json:"StatusUpdate"`
			TimeStamp    time.Time `json:"TimeStamp"`
		} `json:"ProgressUpdates"`
		AssociatedResourceInstanceURI  string `json:"associatedResourceInstanceUri"`
		AssociatedResourceInstanceID   string `json:"associatedResourceInstanceId"`
		AssociatedResourceInstanceType string `json:"associatedResourceInstanceType"`
		State                          string `json:"state"`
		Status                         string `json:"status"`
		Error                          *Error `json:"error"`
		TaskFailed                     bool   `json:"taskFailed"`
		Created                        string `json:"created"`
		Modified                       string `json:"modified"`
	} `json:"esxLcmTask"`
	NetworkSettings struct {
		NcsManagementNetwork string   `json:"ncsManagementNetwork"`
		EsxManagementNetwork string   `json:"esxManagementNetwork"`
		StorageNetwork       string   `json:"storageNetwork"`
		VMotionNetwork       string   `json:"vMotionNetwork"`
		ProductionNetwork    []string `json:"productionNetwork"`
		PhysicalNetworks     []struct {
			Name        string `json:"name"`
			NetworkType string `json:"networkType"`
		} `json:"physicalNetworks"`
	} `json:"networkSettings"`
	VcenterSettings struct {
		IPAddress string `json:"ipAddress"`
		Username  string `json:"username"`
		Password  string `json:"password"`
		Port      int    `json:"port"`
	} `json:"vcenterSettings"`
	Managed         bool       `json:"managed"`
	URI             string     `json:"uri"`
	ZoneTypeURI     string     `json:"zoneTypeUri"`
	ProjectUris     []string   `json:"projectUris"`
	Projects        []*Project `json:"projects"`
	ResourceProfile struct {
		ID          string `json:"id"`
		Name        string `json:"name"`
		Description string `json:"description"`
	} `json:"resourceProfile"`
	Default             bool         `json:"default"`
	ApplianceURI        string       `json:"applianceUri"`
	KvmServers          []*KvmServer `json:"kvmServers"`
	InTransitKvmServers []KvmServer  `json:"inTransitKvmServers"`
}

type ZoneAction

type ZoneAction struct {
	Type        string       `json:"type"`
	ResourceOps *ResourceOps `json:"resourceOps"`
}

type ZoneList

type ZoneList struct {
	Total   int    `json:"total"`
	Members []Zone `json:"members"`
}

type ZoneRequest

type ZoneRequest struct {
	Name            string `json:"name"`
	ProviderURI     string `json:"providerUri"`
	RegionURI       string `json:"regionUri"`
	ZoneTypeURI     string `json:"zoneTypeUri"`
	ApplianceURI    string `json:"applianceUri"`
	NetworkSettings struct {
		NcsManagementNetwork string   `json:"ncsManagementNetwork"`
		EsxManagementNetwork string   `json:"esxManagementNetwork"`
		StorageNetwork       string   `json:"storageNetwork"`
		VMotionNetwork       string   `json:"vMotionNetwork"`
		ProductionNetwork    []string `json:"productionNetwork"`
		PhysicalNetworks     []struct {
			Name        string `json:"name"`
			NetworkType string `json:"networkType"`
		} `json:"physicalNetworks"`
	} `json:"networkSettings"`
	VcenterSettings struct {
		IPAddress string `json:"ipAddress"`
		Username  string `json:"username"`
		Password  string `json:"password"`
		Port      int    `json:"port"`
	} `json:"vcenterSettings"`
	ResourceProfile struct {
		ID          string `json:"id"`
		Name        string `json:"name"`
		Description string `json:"description"`
	} `json:"resourceProfile"`
	ResourceCapacity int `json:"resourceCapacity"`
	Rates            []struct {
		MetricName string `json:"metricName"`
		RateValue  int    `json:"rateValue"`
	} `json:"rates"`
}

type ZoneType

type ZoneType struct {
	ID       string    `json:"id"`
	Name     string    `json:"name"`
	URI      string    `json:"uri"`
	Created  time.Time `json:"created"`
	Modified time.Time `json:"modified"`
}

type ZoneTypeList

type ZoneTypeList struct {
	Total   int        `json:"total"`
	Members []ZoneType `json:"members"`
}

type ZoneTypeResourceProfile

type ZoneTypeResourceProfile struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type ZoneTypeResourceProfileList

type ZoneTypeResourceProfileList struct {
	Total   int                       `json:"total"`
	Members []ZoneTypeResourceProfile `json:"members"`
}

Directories

Path Synopsis
FMT Logger - a very simplistic implementation for logger - everything is printed through fmt - stores history with sensitive data scrubbing
FMT Logger - a very simplistic implementation for logger - everything is printed through fmt - stores history with sensitive data scrubbing

Jump to

Keyboard shortcuts

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