Documentation
¶
Overview ¶
Code generated by sdkgen from Gophercloud v2.15.0; DO NOT EDIT.
Index ¶
- type API
- func (a *API) AllProjects(ctx context.Context, options ...ListOption) ([]*QuotaResource, error)
- func (a *API) CurrentProject(ctx context.Context) (*ProjectQuotaScope, error)
- func (a *API) Delete(ctx context.Context, projectID string) error
- func (a *API) Get(ctx context.Context, projectID string) (*Quota, error)
- func (a *API) GetDetail(ctx context.Context, projectID string) (*QuotaDetailSet, error)
- func (a *API) InProject(ctx context.Context, ref resource.Ref, options ...ProjectOption) (*ProjectQuotaScope, error)
- func (a *API) ListProjects(ctx context.Context, options ...ListOption) iter.Seq2[*QuotaResource, error]
- func (a *API) RawClient() *gophercloud.ServiceClient
- func (a *API) Update(ctx context.Context, projectID string, opts UpdateOpts, ...) (*Quota, error)
- type DeleteOption
- type DeleteResponse
- type DeleteResult
- type GetDetailResult
- type GetResult
- type ListOption
- type ProjectOption
- type ProjectQuotaScope
- func (s *ProjectQuotaScope) Defaults(ctx context.Context) (*QuotaResource, error)
- func (s *ProjectQuotaScope) Delete(ctx context.Context, options ...DeleteOption) (*DeleteResponse, error)
- func (s *ProjectQuotaScope) Detail(ctx context.Context) (*QuotaDetailResource, error)
- func (s *ProjectQuotaScope) Get(ctx context.Context) (*QuotaResource, error)
- func (s *ProjectQuotaScope) ProjectID() string
- func (s *ProjectQuotaScope) Update(ctx context.Context, opts UpdateOpts, options ...UpdateOption) (*QuotaResource, error)
- type Quota
- type QuotaDetail
- type QuotaDetailResource
- type QuotaDetailSet
- type QuotaResource
- type UpdateOption
- type UpdateOpts
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API owns the client and provides concrete inputs, optional extensions and normalized results.
func New ¶
func New(client *gophercloud.ServiceClient) *API
func (*API) AllProjects ¶
func (a *API) AllProjects(ctx context.Context, options ...ListOption) ([]*QuotaResource, error)
AllProjects consumes ListProjects and returns an independently owned slice. A response, row or cancellation error returns no partial result slice.
func (*API) CurrentProject ¶
func (a *API) CurrentProject(ctx context.Context) (*ProjectQuotaScope, error)
CurrentProject reads the recorded Keystone v3 project or v2 token tenant. It never guesses a project from the endpoint URL or a manual token string.
func (*API) Delete ¶
Delete invokes the upstream API with library-owned builders and result handling.
func (*API) GetDetail ¶
GetDetail invokes the upstream API with library-owned builders and result handling.
func (*API) InProject ¶
func (a *API) InProject(ctx context.Context, ref resource.Ref, options ...ProjectOption) (*ProjectQuotaScope, error)
InProject fixes the target once. IDs require no lookup; names use a separate Keystone client with the shared exact-name and ambiguity policy.
func (*API) ListProjects ¶
func (a *API) ListProjects(ctx context.Context, options ...ListOption) iter.Seq2[*QuotaResource, error]
ListProjects lazily fetches quota rows for projects with quota overrides. The server merges those overrides with default limits. Projects without an override do not appear; this is not a Keystone project enumeration.
Neutron's quota controller returns one array and supports no list query or continuation. Each visited row is decoded before applying the local filter.
func (*API) RawClient ¶
func (a *API) RawClient() *gophercloud.ServiceClient
func (*API) Update ¶
func (a *API) Update(ctx context.Context, projectID string, opts UpdateOpts, options ...UpdateOption) (*Quota, error)
Update invokes the upstream API with library-owned builders and result handling.
type DeleteOption ¶
type DeleteOption func(*deleteOptions) error
DeleteOption changes the missing-project policy when resetting overrides.
func WithDeleteIgnoreMissing ¶
func WithDeleteIgnoreMissing(ignore bool) DeleteOption
WithDeleteIgnoreMissing suppresses only HTTP 404. The default is strict; later options override earlier ones, including an explicit false.
type DeleteResponse ¶
DeleteResponse contains the reset response metadata; Delete does not fetch defaults or infer the resulting quota limits.
type DeleteResult ¶
type DeleteResult = upstream.DeleteResult
type GetDetailResult ¶
type GetDetailResult = upstream.GetDetailResult
type ListOption ¶
type ListOption func(*listOptions) error
ListOption configures SDK-side consumption of the single Neutron quota collection. It does not add server query or pagination parameters.
func WithListMaxItems ¶
func WithListMaxItems(n int) ListOption
WithListMaxItems stops consumption after n matching rows. It does not limit the HTTP response or decode rows after the limit has been reached.
func WithListProjectID ¶
func WithListProjectID(id string) ListOption
WithListProjectID restricts yielded rows to this exact project ID locally. Neutron still returns its whole quota override collection in one response.
type ProjectOption ¶
type ProjectOption func(*projectOptions) error
ProjectOption configures the one-time project resolution for a quota scope.
func WithIdentityClient ¶
func WithIdentityClient(client *gophercloud.ServiceClient) ProjectOption
WithIdentityClient supplies the Keystone v3 client used for exact project name resolution. The Network client is never used to query Keystone.
type ProjectQuotaScope ¶
type ProjectQuotaScope struct {
// contains filtered or unexported fields
}
ProjectQuotaScope fixes one Neutron project's quota singleton. Delete resets its quota overrides; the scope does not expose resource creation or listing.
func (*ProjectQuotaScope) Defaults ¶
func (s *ProjectQuotaScope) Defaults(ctx context.Context) (*QuotaResource, error)
Defaults fetches the project's default limits, independently of its quota overrides. Neutron returns these from /quotas/{project}/default, not Get.
func (*ProjectQuotaScope) Delete ¶
func (s *ProjectQuotaScope) Delete(ctx context.Context, options ...DeleteOption) (*DeleteResponse, error)
Delete resets project overrides. It preserves native accepted 202/204 codes and does not automatically fetch the resulting defaults.
func (*ProjectQuotaScope) Detail ¶
func (s *ProjectQuotaScope) Detail(ctx context.Context) (*QuotaDetailResource, error)
Detail fetches quota usage from /quotas/{project}/details.json. The server determines whether the quota_details extension is available.
func (*ProjectQuotaScope) Get ¶
func (s *ProjectQuotaScope) Get(ctx context.Context) (*QuotaResource, error)
Get fetches the project's quota limits using the native member endpoint.
func (*ProjectQuotaScope) ProjectID ¶
func (s *ProjectQuotaScope) ProjectID() string
ProjectID returns the fixed request target without a request.
func (*ProjectQuotaScope) Update ¶
func (s *ProjectQuotaScope) Update(ctx context.Context, opts UpdateOpts, options ...UpdateOption) (*QuotaResource, error)
Update sends only supplied limits: nil omits, zero is explicit and -1 is unlimited. The body is serialized before the first HTTP request or retry.
type QuotaDetail ¶
type QuotaDetail = upstream.QuotaDetail
type QuotaDetailResource ¶
type QuotaDetailResource struct {
QuotaDetailSet
ProjectID string
Body map[string]json.RawMessage
Header http.Header
StatusCode int
}
QuotaDetailResource retains native Used/Reserved/Limit values and raw detail fields, including unknown extensions and reserved values returned as strings.
type QuotaDetailSet ¶
type QuotaDetailSet = upstream.QuotaDetailSet
type QuotaResource ¶
type QuotaResource struct {
Quota
ProjectID string
Body map[string]json.RawMessage
Header http.Header
StatusCode int
}
QuotaResource retains native limits, raw quota fields and response headers. A scope's ProjectID remains its request target even if the response names another ID. ListProjects instead uses the validated project identity in the row.
type UpdateOption ¶
type UpdateOption = request.Option[UpdateOpts]
func WithQuotaOptions ¶
func WithQuotaOptions(options UpdateOpts) UpdateOption
WithQuotaOptions snapshots native typed limits when the option is created. Every application gets fresh pointers, so an option remains reusable.
func WithUpdateCheckLimit ¶
func WithUpdateCheckLimit(check bool) UpdateOption
WithUpdateCheckLimit explicitly sends check_limit, including false. This is a ProjectQuotaScope.Update option; the lower-level API retains native opts. Server extension support and usage-check policy are not inferred by the SDK.
func WithUpdateField ¶
func WithUpdateField(key string, value any) UpdateOption
func WithUpdateOptions ¶
func WithUpdateOptions(value UpdateOpts) UpdateOption
type UpdateOpts ¶
type UpdateOpts = upstream.UpdateOpts
type UpdateResult ¶
type UpdateResult = upstream.UpdateResult