zones

package
v0.0.0-...-f8ec1b3 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package tokens provides information and interaction with the zone API resource for the OpenStack DNS service.

For more information, see: http://developer.openstack.org/api-ref/dns/#zone

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type CreateOpts

type CreateOpts struct {
	// Attributes are settings that supply hints and filters for the zone.
	Attributes map[string]string `json:"attributes,omitempty"`

	// Email contact of the zone.
	Email string `json:"email,omitempty"`

	// Description of the zone.
	Description string `json:"description,omitempty"`

	// Name of the zone.
	Name string `json:"name" required:"true"`

	// Masters specifies zone masters if this is a secondary zone.
	Masters []string `json:"masters,omitempty"`

	// TTL is the time to live of the zone.
	TTL int `json:"-"`

	// Type specifies if this is a primary or secondary zone.
	Type string `json:"type,omitempty"`
}

CreateOpts specifies the base attributes used to create a zone.

func (CreateOpts) ToZoneCreateMap

func (opts CreateOpts) ToZoneCreateMap() (map[string]interface{}, error)

ToZoneCreateMap formats an CreateOpts structure into a request body.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToZoneCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional attributes to the Update request.

type CreateResult

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

CreateResult is the deferred result of a Create call.

func Create

func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

Create a zone

func (CreateResult) Extract

func (r CreateResult) Extract() (*Zone, error)

Extract interprets a GetResult, CreateResult or UpdateResult as a concrete Zone. An error is returned if the original call or the extraction failed.

type DeleteResult

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

DeleteResult is the deferred result of an Delete call.

func Delete

func Delete(client *gophercloud.ServiceClient, zoneID string) (r DeleteResult)

Delete a zone.

func (DeleteResult) Extract

func (r DeleteResult) Extract() (*Zone, error)

Extract interprets a GetResult, CreateResult or UpdateResult as a concrete Zone. An error is returned if the original call or the extraction failed.

type GetResult

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

GetResult is the deferred result of a Get call.

func Get

func Get(client *gophercloud.ServiceClient, zoneID string) (r GetResult)

Get returns additional information about a zone, given its ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Zone, error)

Extract interprets a GetResult, CreateResult or UpdateResult as a concrete Zone. An error is returned if the original call or the extraction failed.

type ListOpts

type ListOpts struct {
	// Integer value for the limit of values to return.
	Limit int `q:"limit"`

	// UUID of the zone at which you want to set a marker.
	Marker string `q:"marker"`

	Description string `q:"description"`
	Email       string `q:"email"`
	Name        string `q:"name"`
	SortDir     string `q:"sort_dir"`
	SortKey     string `q:"sort_key"`
	Status      string `q:"status"`
	TTL         int    `q:"ttl"`
	Type        string `q:"type"`
}

ListOpts allows the filtering and sorting of paginated collections through the API. Filtering is achieved by passing in struct field values that map to the server attributes you want to see returned. Marker and Limit are used for pagination. https://developer.openstack.org/api-ref/dns/

func (ListOpts) ToZoneListQuery

func (opts ListOpts) ToZoneListQuery() (string, error)

type ListOptsBuilder

type ListOptsBuilder interface {
	ToZoneListQuery() (string, error)
}

type UpdateOpts

type UpdateOpts struct {
	Email       string   `json:"email,omitempty"`
	TTL         int      `json:"-"`
	Masters     []string `json:"masters,omitempty"`
	Description string   `json:"description,omitempty"`
}

UpdateOpts specifies the base attributes to update a zone.

func (UpdateOpts) ToZoneUpdateMap

func (opts UpdateOpts) ToZoneUpdateMap() (map[string]interface{}, error)

ToZoneUpdateMap formats an UpdateOpts structure into a request body.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToZoneUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder allows extensions to add additional attributes to the Update request.

type UpdateResult

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

UpdateResult is the deferred result of an Update call.

func Update

func Update(client *gophercloud.ServiceClient, zoneID string, opts UpdateOptsBuilder) (r UpdateResult)

Update a zone.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Zone, error)

Extract interprets a GetResult, CreateResult or UpdateResult as a concrete Zone. An error is returned if the original call or the extraction failed.

type Zone

type Zone struct {
	// ID uniquely identifies this zone amongst all other zones, including those not accessible to the current tenant.
	ID string `json:"id"`

	// PoolID is the ID for the pool hosting this zone.
	PoolID string `json:"pool_id"`

	// ProjectID identifies the project/tenant owning this resource.
	ProjectID string `json:"project_id"`

	// Name is the DNS Name for the zone.
	Name string `json:"name"`

	// Email for the zone. Used in SOA records for the zone.
	Email string `json:"email"`

	// Description for this zone.
	Description string `json:"description"`

	// TTL is the Time to Live for the zone.
	TTL int `json:"ttl"`

	// Serial is the current serial number for the zone.
	Serial int `json:"-"`

	// Status is the status of the resource.
	Status string `json:"status"`

	// Action is the current action in progress on the resource.
	Action string `json:"action"`

	// Version of the resource.
	Version int `json:"version"`

	// Attributes for the zone.
	Attributes map[string]string `json:"attributes"`

	// Type of zone. Primary is controlled by Designate.
	// Secondary zones are slaved from another DNS Server.
	// Defaults to Primary.
	Type string `json:"type"`

	// Masters is the servers for slave servers to get DNS information from.
	Masters []string `json:"masters"`

	// CreatedAt is the date when the zone was created.
	CreatedAt time.Time `json:"-"`

	// UpdatedAt is the date when the last change was made to the zone.
	UpdatedAt time.Time `json:"-"`

	// TransferredAt is the last time an update was retrieved from the master servers.
	TransferredAt time.Time `json:"-"`

	// Links includes HTTP references to the itself, useful for passing along to other APIs that might want a server reference.
	Links map[string]interface{} `json:"links"`
}

Zone represents a DNS zone.

func ExtractZones

func ExtractZones(r pagination.Page) ([]Zone, error)

ExtractZones extracts a slice of Services from a Collection acquired from List.

func (*Zone) UnmarshalJSON

func (r *Zone) UnmarshalJSON(b []byte) error

type ZonePage

type ZonePage struct {
	pagination.LinkedPageBase
}

ZonePage is a single page of Zone results.

func (ZonePage) IsEmpty

func (r ZonePage) IsEmpty() (bool, error)

IsEmpty returns true if the page contains no results.

Directories

Path Synopsis
dns_zones_v2
dns_zones_v2

Jump to

Keyboard shortcuts

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