// Returns all networks func (api *NetworksAPI) GetAll(options *NetworkGetOptions) (result *Networks, err error) { uri := api.client.Endpoint + networkUrl if options != nil { uri += getQueryString(options) } res, err := rest.GetList(api.client.httpClient, api.client.Endpoint, uri, api.client.options.TokenOptions.AccessToken) result = &Networks{} err = json.Unmarshal(res, result) return }
// Returns all availability zones on an photon instance. func (api *AvailabilityZonesAPI) GetAll() (result *AvailabilityZones, err error) { uri := api.client.Endpoint + availabilityzoneUrl res, err := rest.GetList(api.client.httpClient, api.client.Endpoint, uri, api.client.options.TokenOptions.AccessToken) if err != nil { return } result = &AvailabilityZones{} err = json.Unmarshal(res, result) return }
// Gets all the vms with the specified deployment ID. func (api *DeploymentsAPI) GetVms(id string) (result *VMs, err error) { uri := api.client.Endpoint + deploymentUrl + "/" + id + "/vms" res, err := rest.GetList(api.client.httpClient, api.client.Endpoint, uri, api.client.options.TokenOptions.AccessToken) if err != nil { return } result = &VMs{} err = json.Unmarshal(res, result) return }
// Gets clusters for project with the specified ID func (api *ProjectsAPI) GetClusters(projectID string) (result *Clusters, err error) { uri := api.client.Endpoint + projectUrl + projectID + "/clusters" res, err := rest.GetList(api.client.httpClient, api.client.Endpoint, uri, api.client.options.TokenOptions.AccessToken) if err != nil { return } result = &Clusters{} err = json.Unmarshal(res, result) return }
// Returns all tenants on an photon instance. func (api *TenantsAPI) GetAll() (result *Tenants, err error) { uri := api.client.Endpoint + tenantUrl res, err := rest.GetList(api.client.httpClient, api.client.Endpoint, uri, api.client.options.TokenOptions.AccessToken) if err != nil { return } result = &Tenants{} err = json.Unmarshal(res, result) return }
// Gets all images on this photon instance. func (api *ImagesAPI) GetAll() (images *Images, err error) { uri := api.client.Endpoint + imageUrl res, err := rest.GetList(api.client.httpClient, api.client.Endpoint, uri, api.client.options.TokenOptions.AccessToken) if err != nil { return } images = &Images{} err = json.Unmarshal(res, images) return }
// Gets flavors using options to filter results. Returns all flavors if options is nil. func (api *FlavorsAPI) GetAll(options *FlavorGetOptions) (flavors *FlavorList, err error) { uri := api.client.Endpoint + flavorUrl if options != nil { uri += getQueryString(options) } res, err := rest.GetList(api.client.httpClient, api.client.Endpoint, uri, api.client.options.TokenOptions.AccessToken) if err != nil { return } flavors = &FlavorList{} err = json.Unmarshal(res, flavors) return }
// Gets disks for project with the specified ID, using options to filter the results. // If options is nil, no filtering will occur. func (api *ProjectsAPI) GetDisks(projectID string, options *DiskGetOptions) (result *DiskList, err error) { uri := api.client.Endpoint + projectUrl + projectID + "/disks" if options != nil { uri += getQueryString(options) } res, err := rest.GetList(api.client.httpClient, api.client.Endpoint, uri, api.client.options.TokenOptions.AccessToken) if err != nil { return } result = &DiskList{} err = json.Unmarshal(res, result) return }
// Gets all tasks with the specified vm ID, using options to filter the results. // If options is nil, no filtering will occur. func (api *VmAPI) GetTasks(id string, options *TaskGetOptions) (result *TaskList, err error) { uri := api.client.Endpoint + vmUrl + id + "/tasks" if options != nil { uri += getQueryString(options) } res, err := rest.GetList(api.client.httpClient, api.client.Endpoint, uri, api.client.options.TokenOptions.AccessToken) if err != nil { return } result = &TaskList{} err = json.Unmarshal(res, result) return }
// Gets resource tickets for tenant with the specified ID, using options to filter the results. // If options is nil, no filtering will occur. func (api *TenantsAPI) GetResourceTickets(tenantId string, options *ResourceTicketGetOptions) (tickets *ResourceList, err error) { uri := api.client.Endpoint + tenantUrl + "/" + tenantId + "/resource-tickets" if options != nil { uri += getQueryString(options) } res, err := rest.GetList(api.client.httpClient, api.client.Endpoint, uri, api.client.options.TokenOptions.AccessToken) if err != nil { return } tickets = &ResourceList{} err = json.Unmarshal(res, tickets) return }
// Gets the projects for tenant with the specified ID, using options to filter the results. // If options is nil, no filtering will occur. func (api *TenantsAPI) GetProjects(tenantId string, options *ProjectGetOptions) (result *ProjectList, err error) { uri := api.client.Endpoint + tenantUrl + "/" + tenantId + "/projects" if options != nil { uri += getQueryString(options) } res, err := rest.GetList(api.client.httpClient, api.client.Endpoint, uri, api.client.options.TokenOptions.AccessToken) if err != nil { return } result = &(ProjectList{}) err = json.Unmarshal(res, result) return }