Documentation
¶
Overview ¶
Package quotas provides the ability to retrieve DNS quotas through the Designate API.
Example to Get a Quota Set
projectID = "23d5d3f79dfa4f73b72b8b0b0063ec55"
quotasInfo, err := quotas.Get(context.TODO(), dnsClient, projectID).Extract()
if err != nil {
log.Fatal(err)
}
fmt.Printf("quotas: %#v\n", quotasInfo)
Example to Update a Quota Set
projectID = "23d5d3f79dfa4f73b72b8b0b0063ec55"
zones := 10
quota := "as.UpdateOpts{
Zones: &zones,
}
quotasInfo, err := quotas.Update(context.TODO(), dnsClient, projectID, quota).Extract()
if err != nil {
log.Fatal(err)
}
fmt.Printf("quotas: %#v\n", quotasInfo)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func URL ¶
func URL(c *gophercloud.ServiceClient, projectID string) string
Types ¶
type Quota ¶
type Quota struct {
APIExporterSize int `json:"api_export_size"`
RecordsetRecords int `json:"recordset_records"`
ZoneRecords int `json:"zone_records"`
ZoneRecordsets int `json:"zone_recordsets"`
Zones int `json:"zones"`
}
Quota represents a quotas on the system.
type Result ¶
type Result struct {
gophercloud.Result
}
ListResult is the result of a Create request. Call its Extract method to interpret the result as a Zone.
func Get ¶
func Get(ctx context.Context, client *gophercloud.ServiceClient, projectID string) (r Result)
Get returns information about the quota for a given project ID.
func Update ¶
func Update(ctx context.Context, c *gophercloud.ServiceClient, projectID string, opts UpdateOptsBuilder) (r Result)
Update accepts a UpdateOpts struct and updates an existing DNS Quotas using the values provided.
type UpdateOpts ¶
type UpdateOpts struct {
APIExporterSize *int `json:"api_export_size,omitempty"`
RecordsetRecords *int `json:"recordset_records,omitempty"`
ZoneRecords *int `json:"zone_records,omitempty"`
ZoneRecordsets *int `json:"zone_recordsets,omitempty"`
Zones *int `json:"zones,omitempty"`
}
UpdateOpts represents options used to update the DNS Quotas.
func (UpdateOpts) ToQuotaUpdateMap ¶
func (opts UpdateOpts) ToQuotaUpdateMap() (map[string]interface{}, error)
ToQuotaUpdateMap builds a request body from UpdateOpts.
type UpdateOptsBuilder ¶
UpdateOptsBuilder allows extensions to add additional parameters to the Update request.