Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractRegionsInto ¶
func ExtractRegionsInto(r pagination.Page, v interface{}) error
func List ¶
func List(c *gcorecloud.ServiceClient) pagination.Pager
Types ¶
type CreateOpts ¶
type CreateOpts struct { DisplayName string `json:"display_name" required:"true" validate:"required"` KeystoneName string `json:"keystone_name" required:"true" validate:"required"` State types.RegionState `json:"state" required:"true" validate:"required,enum"` EndpointType types.EndpointType `json:"endpoint_type,omitempty" validate:"omitempty,enum"` ExternalNetworkID string `json:"external_network_id" required:"true" validate:"required,uuid4"` SpiceProxyURL *gcorecloud.URL `json:"spice_proxy_url,omitempty"` KeystoneID int `json:"keystone_id" required:"true" validate:"required"` }
CreateOpts represents options used to create a region.
func (CreateOpts) ToRegionCreateMap ¶
func (opts CreateOpts) ToRegionCreateMap() (map[string]interface{}, error)
ToRegionCreateMap builds a request body from CreateOpts.
type CreateOptsBuilder ¶
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
type CreateResult ¶
type CreateResult struct {
// contains filtered or unexported fields
}
CreateResult represents the result of a create operation. Call its Extract method to interpret it as a Region.
func Create ¶
func Create(c *gcorecloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
Create accepts a CreateOpts struct and creates a new region using the values provided.
func (CreateResult) Extract ¶
Extract is a function that accepts a result and extracts a region resource.
func (CreateResult) ExtractInto ¶
func (r CreateResult) ExtractInto(v interface{}) error
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult represents the result of a get operation. Call its Extract method to interpret it as a Region.
func Get ¶
func Get(c *gcorecloud.ServiceClient, id int) (r GetResult)
Get retrieves a specific region based on its unique ID.
func (GetResult) Extract ¶
Extract is a function that accepts a result and extracts a region resource.
func (GetResult) ExtractInto ¶
func (r GetResult) ExtractInto(v interface{}) error
type Region ¶
type Region struct { ID int `json:"id"` DisplayName string `json:"display_name"` KeystoneName string `json:"keystone_name"` State types.RegionState `json:"state"` TaskID *string `json:"task_id"` EndpointType types.EndpointType `json:"endpoint_type"` ExternalNetworkID string `json:"external_network_id"` SpiceProxyURL gcorecloud.URL `json:"spice_proxy_url"` CreatedOn gcorecloud.JSONRFC3339NoZ `json:"created_on"` KeystoneID int `json:"keystone_id"` Keystone keystones.Keystone `json:"keystone"` HasBaremetal bool `json:"has_baremetal"` AvailableVolumeTypes []string `json:"available_volume_types"` }
Region represents a region structure.
func ExtractRegions ¶
func ExtractRegions(r pagination.Page) ([]Region, error)
ExtractRegion accepts a Page struct, specifically a RegionPage struct, and extracts the elements into a slice of Region structs. In other words, a generic collection is mapped into a relevant slice.
func ListAll ¶
func ListAll(client *gcorecloud.ServiceClient) ([]Region, error)
ListAll is a convenience function that returns all regions.
type RegionPage ¶
type RegionPage struct {
pagination.LinkedPageBase
}
RegionPage is the page returned by a pager when traversing over a collection of regions.
func (RegionPage) IsEmpty ¶
func (r RegionPage) IsEmpty() (bool, error)
IsEmpty checks whether a RegionPage struct is empty.
func (RegionPage) NextPageURL ¶
func (r RegionPage) NextPageURL() (string, error)
NextPageURL is invoked when a paginated collection of regions has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.
type UpdateOpts ¶
type UpdateOpts struct { DisplayName string `json:"display_name,omitempty" validate:"required_without_all=State EndpointType ExternalNetworkID SpiceProxyURL,omitempty"` State types.RegionState `` /* 126-byte string literal not displayed */ EndpointType types.EndpointType `` /* 127-byte string literal not displayed */ ExternalNetworkID string `` /* 129-byte string literal not displayed */ SpiceProxyURL *gcorecloud.URL `json:"spice_proxy_url,omitempty" validate:"required_without_all=DisplayName State EndpointType ExternalNetworkID,omitempty"` }
UpdateOpts represents options used to update a region.
func (UpdateOpts) ToRegionUpdateMap ¶
func (opts UpdateOpts) ToRegionUpdateMap() (map[string]interface{}, error)
ToRegionUpdateMap builds a request body from UpdateOpts.
type UpdateOptsBuilder ¶
UpdateOptsBuilder allows extensions to add additional parameters to the Update request.
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
UpdateResult represents the result of an update operation. Call its Extract method to interpret it as a Region.
func Update ¶
func Update(c *gcorecloud.ServiceClient, id int, opts UpdateOptsBuilder) (r UpdateResult)
Update accepts a UpdateOpts struct and updates an existing region using the values provided.
func (UpdateResult) Extract ¶
Extract is a function that accepts a result and extracts a region resource.
func (UpdateResult) ExtractInto ¶
func (r UpdateResult) ExtractInto(v interface{}) error