Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
List retrieves a list segment.
Types ¶
type CreateOpts ¶
type CreateOpts struct { // Name The segment name. Name string `json:"name" required:"true"` // RecoveryMethod Type of recovery if any host in this segment goes down. User can mention either // ‘auto’, ‘reserved_host’, ‘auto_priority’ or ‘rh_priority’. RecoveryMethod string `json:"recovery_method" required:"true"` // ServiceType The name of service which will be deployed in this segment. // As of now user can mention ‘COMPUTE’ as service_type. ServiceType string `json:"service_type" required:"true"` // Enabled Boolean whether this segment is enabled or not. Enabled bool `json:"enabled,omitempty"` // Description The segment description. Description string `json:"description,omitempty"` }
CreateOpts provides options used to add a segment.
func (CreateOpts) ToContainerCreateMap ¶
func (opts CreateOpts) ToContainerCreateMap() (map[string]interface{}, error)
ToContainerCreateMap formats a CreateOpts into a create request.
type CreateOptsBuilder ¶
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
type CreateResult ¶
type CreateResult struct {
// contains filtered or unexported fields
}
CreateResult is the response from a Create operation. Call its Extract method to interpret it as a Segment.
func Create ¶
func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
Create creates a new segment.
func (CreateResult) Extract ¶
func (r CreateResult) Extract() (*FailoverSegment, error)
Extract interprets any commonResult as a Segment.
type DeleteResult ¶
type DeleteResult struct {
gophercloud.ErrResult
}
DeleteResult is the response from a Delete operation. Call its ExtractErr to determine if the request succeeded or failed.
func Delete ¶
func Delete(client *gophercloud.ServiceClient, segmentID string) (r DeleteResult)
Delete deletes a segment.
type FailoverSegment ¶
type FailoverSegment struct { // ID The Id of the segment. ID int `json:"id"` // Name The segment name. Name string `json:"name"` // Description A free form description of the segment. Limited to 255 characters in length. Description string `json:"description"` // Created The date and time stamp when the segment was created. Created string `json:"created"` // Updated The date and time stamp when the segment was updated. Updated string `json:"updated"` // RecoveryMethod Type of recovery if any host in this segment goes down. User can mention either // ‘auto’, ‘reserved_host’, ‘auto_priority’ or ‘rh_priority’. RecoveryMethod string `json:"recovery_method"` // ServiceType The name of service which will be deployed in this segment. // As of now user can mention ‘COMPUTE’ as service_type. ServiceType string `json:"service_type"` // Enabled Boolean whether this segment is enabled or not. Enabled bool `json:"enabled"` // UUID The UUID of the segment. UUID string `json:"uuid"` }
func ExtractSegments ¶
func ExtractSegments(r pagination.Page) ([]FailoverSegment, error)
ExtractSegments returns a slice of Segments in a single page of results.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult is the response from a Get operation. Call its Extract method to interpret it as a Segment.
func Get ¶
func Get(client *gophercloud.ServiceClient, segmentID string) (r GetResult)
Get retrieves details of a segment.
func (GetResult) Extract ¶
func (r GetResult) Extract() (*FailoverSegment, error)
Extract interprets any commonResult as a Segment.
type ListOpts ¶
type ListOpts struct { // Limit is the amount of containers to retrieve. Limit int `q:"limit"` // Marker The ID of the last-seen item. Use the limit parameter to make an initial limited request and use the // ID of the last-seen item from the response as the marker parameter value in a subsequent limited request. Marker string `q:"marker"` // RecoveryMethod Filter the segment list result by recovery_method. RecoveryMethod bool `q:"recovery_method"` // ServiceType Filter the segment list result by service_type. ServiceType string `q:"service_type"` // Enabled Boolean whether this segment is enabled or not. Enabled bool `q:"enabled"` // SortDir Sort direction. A valid value is asc (ascending) or desc (descending). Default is desc. // You can specify multiple pairs of sort key and sort direction query parameters. If you omit the sort direction in // a pair, the API uses the natural sorting direction of the direction of the segment sort_key attribute. SortDir string `q:"sort_dir"` // SortKey Sorts by a hosts attribute. Default attribute is created_at. You can specify multiple pairs of sort key // and sort direction query parameters. If you omit the sort direction in a pair, the API uses the natural sorting // direction of the segment sort_key attribute. The sort keys are limited to: // created_at, description, name, updated_at, uuid, recovery_method, service_type SortKey string `q:"sort_key"` }
ListOpts provides options to filter the List results.
func (ListOpts) ToContainerListQuery ¶
ToContainerListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request
type SegmentsPage ¶
type SegmentsPage struct {
pagination.LinkedPageBase
}
SegmentsPage is a single page of container results.
func (SegmentsPage) IsEmpty ¶
func (r SegmentsPage) IsEmpty() (bool, error)
IsEmpty determines whether or not a page of Container contains any results.
func (SegmentsPage) NextPageURL ¶
func (r SegmentsPage) NextPageURL() (string, error)
NextPageURL extracts the "next" link from the links section of the result.
type UpdateOpts ¶
type UpdateOpts struct { // Name The segment name. Name string `json:"name" required:"true"` // RecoveryMethod Type of recovery if any host in this segment goes down. User can mention either // ‘auto’, ‘reserved_host’, ‘auto_priority’ or ‘rh_priority’. RecoveryMethod string `json:"recovery_method" required:"true"` // ServiceType The name of service which will be deployed in this segment. // As of now user can mention ‘COMPUTE’ as service_type. ServiceType string `json:"service_type" required:"true"` // Enabled Boolean whether this segment is enabled or not. Enabled bool `json:"enabled,omitempty"` // Description The segment description. Description string `json:"description,omitempty"` }
UpdateOpts provides options used to update a segment.
func (UpdateOpts) ToUpdateRequest ¶
func (opts UpdateOpts) ToUpdateRequest() (map[string]interface{}, error)
ToUpdateRequest formats a UpdateOpts into an update request.
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
UpdateResult is the response from a Create operation. Call its Extract method to interpret it as a Segment.
func Update ¶
func Update(client *gophercloud.ServiceClient, segmentID string, opts UpdateOpts) (r UpdateResult)
Update will update a segment.
func (UpdateResult) Extract ¶
func (r UpdateResult) Extract() (*FailoverSegment, error)
Extract interprets any commonResult as a Segment.