handler

package
v1.16.6 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

README

pkg/handler

This package is the API application layer for region.

Intent

The handler layer sits below middleware and above persisted Kubernetes resources, provider abstractions, and a small amount of cross-service API coordination with identity.

It is where the region API turns:

  • authenticated and authorized request context
  • OpenAPI request/response models
  • CRD-backed storage
  • provider-backed non-CRD capabilities

into resource-specific behaviour.

At the top level, handler.go, handler_v2.go, handler_v2_server.go, and the image-specific glue are mostly transport wiring: they perform final handler-level RBAC checks where needed, read request bodies, delegate to resource-specific clients, and normalize response and error handling. The real package behaviour lives in the per-resource clients beneath them.

The most important architectural fact in this package is that v2 is the intended handler model. v1 is deprecated compatibility surface and should be migrated away from as quickly as practical.

So this package should be understood primarily in v2 terms:

  • flatter API shapes
  • direct resource lookup in a shared namespace
  • label- and relationship-derived scope
  • selector-prefiltered list operations
  • saga-backed multi-object workflows where needed

v1 remains important only because migration is not complete yet.

Shared Handler Model

Most handler clients follow the same broad pattern:

  1. resolve logical scope and visibility — including region ACL enforcement via region.CheckAccess for any operation that accepts a user-supplied region ID (path parameter, query parameter, or request body field)
  2. load current state where mutation is involved
  3. convert API request shape into required stored or provider-facing shape
  4. merge system-owned metadata and derived context
  5. write back with conflict detection where applicable
  6. convert stored or provider-derived state back into API read models

This is not a blind REST-to-CRD translation layer. The handler layer is allowed to enforce cross-resource invariants, repair missing operational context, manage best-effort consistency across multiple objects, and reject requests that would create obviously broken relationships — including ACL-mediated region access control.

v2 First

v2 is not just a flatter URL scheme. It changes how the handler layer works.

Compared with the older nested v1 model:

  • org/project context is no longer always present in the request path
  • handlers often infer context from the request body or a dependent resource
  • direct resource IDs are favored over path nesting
  • list handlers use query parameters to constrain the working set before RBAC walks it
  • resources created by the newer API are often gated with ResourceAPIVersionLabel=2

This is why the v2 support helpers in util exist at all.

Principal Context Completion

In v1, tenancy context was often explicit in the path.

In v2, write paths such as POST /api/v2/... may not carry organization and project in the URL, but the handler still needs that context for:

  • audit attribution
  • quota charging
  • billing/accounting
  • ownership enforcement

So v2 handlers often recover org/project context from:

  • required request fields
  • or a dependent resource that already carries the binding, such as server -> network
Selector-Prefiltered Lists

v2 list handlers typically:

  1. start from a label selector
  2. add org/project constraints using RBAC query helpers
  3. add region/network constraints where applicable
  4. list from the shared namespace
  5. apply tag filtering
  6. apply per-item RBAC filtering

This is a real scalability and consistency pattern, not incidental code style.

Shared Scoping Model

Unlike identity, region does not primarily resolve user-visible scope into a separate Kubernetes namespace. Most region resources live in one shared namespace.

That means handler scope is reconstructed through:

  • labels
  • owner relationships
  • dependent-resource lookups
  • RBAC checks against recovered organization/project bindings

This is one of the biggest architectural differences from identity/pkg/handler.

Shared Lifecycle Graph

The other major difference from identity is that region makes the platform's lifecycle graph very visible.

In practice, the system behaves like a DAG of resources connected by edges with different semantics. Those edges can encode:

  • propagation: should lifecycle intent flow across this edge?
  • blocking: should deletion or teardown be prevented while this edge exists?

In region, the common edge mechanisms are:

  • Kubernetes owner references for strong propagation and parent blocking
  • foreground deletion for some older v1 roots
  • explicit resource references or finalizers for blocking edges without ownership
  • cross-service consumers for propagation bridges across repositories
  • quota/allocation relationships for accounting consistency edges

Examples:

  • v1 Identity acts as the root of the older ownership tree for dependent resources
  • v2 Network is special and creates its own service-principal identity
  • v2 SecurityGroup, LoadBalancer, and Server are generally owned by a Network
  • SSHCertificateAuthority v2 blocks deletion through explicit reference checks
  • Network v2 supports external references that block deletion

So the lifecycle invariant is:

  • users should delete the visible parent resource
  • handler, controller, and cross-service consumer logic should make downstream propagation or blocking happen appropriately for each edge type
  • clients should not need to hunt for every child manually

Shared Consistency Model

Many handler workflows touch more than one object or subsystem.

Examples include:

  • quota/allocation changes alongside resource creation or update
  • service-principal creation plus network creation
  • resource validation against other resources before mutation
  • provider-backed checks such as image lookup or network suitability

Because the backing store is Kubernetes objects and some workflows also cross service or provider boundaries, there is no transaction layer.

The main consistency tools are:

  • explicit read/modify/write
  • optimistic-locking patch semantics
  • owner refs and deletion blocking
  • saga-based compensating workflows where a handler must coordinate multiple API operations rather than simply write Kubernetes state and rely on watch-driven propagation
Saga Use

This package is the first place in region where the saga pattern becomes a real architectural tool rather than an abstract library concept.

Sagas are used where handlers need ordered multi-step workflows with explicit rollback/compensation, for example:

  • network v2 create
  • loadbalancer v2 create/update
  • storage v2 create/update

That is the handler-layer answer to “we need consistency across multiple steps, but we do not have transactions.”

Resource Patterns

  • identity: deprecated v1 compatibility surface for the still-important service-principal/project-scoping concept
  • region: read-side visibility and capability exposure
  • image: provider-backed image import/query/delete and provenance handling
  • network: core connectivity resource; v2 network is the visible coordination point for a hidden service-principal-backed ownership root
  • securitygroup: network-linked policy resource
  • server: compute lifecycle plus operational verbs and snapshot bridge into image semantics
  • loadbalancer: network-linked service with stronger validation and quota coupling
  • sshcertificateauthority: project-scoped SSH CA records with explicit reference-blocked deletion
  • storage: quota-heavy stateful resource with saga-backed create/update and attachment validation

Caveats

  • v1 and v2 are not equal architectural citizens. v1 is deprecated and should not be treated as the model for future work.
  • The flatter v2 API is better for clients, but it pushes more hidden complexity into handlers:
    • context inference
    • principal repair
    • direct relationship lookup
    • API-version gating
  • Because most resources live in one namespace, label discipline is critical. Scope, visibility, ancestry, and migration state all depend on it.
  • Cross-object invariants are only best-effort. Owner references, finalizers, allocation records, and saga compensation improve consistency, but they do not turn the system into an ACID store.

TODO

  • Continue migrating all remaining v1 handler surfaces to v2 equivalents and then delete the deprecated v1 compatibility paths.
  • Remove handler behaviours that still depend on transitional provider-specific status or older API/storage shapes as those compatibility bridges disappear.
  • Revisit places where the current v2 model still hides an implicit resource or service-principal concept that would be cleaner as an explicit API object.
  • Audit v2 mutation RBAC verbs for copy/paste drift. Some update paths appear to check Delete where Update is more likely to be the intended action.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleError

func HandleError(w http.ResponseWriter, r *http.Request, err error)

HandleError is called when the router has trouble parsong paths.

func MethodNotAllowed

func MethodNotAllowed(w http.ResponseWriter, r *http.Request)

MethodNotAllowed is called from the router when a method is not found for a path.

func NotFound

func NotFound(w http.ResponseWriter, r *http.Request)

NotFound is called from the router when a path is not found.

Types

type Handler

type Handler struct {
	// There are embedded so they can be their own
	*ImageHandler
	*ServerV2Handler
	*ImageV2Handler

	// ClientArgs has the values needed to create the various handler clients.
	common.ClientArgs
	// contains filtered or unexported fields
}

func New

func New(clientArgs common.ClientArgs, options *Options) (*Handler, error)

func (*Handler) DeleteApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityID added in v0.1.23

func (h *Handler) DeleteApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityID(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, projectID openapi.ProjectIDParameter, identityID openapi.IdentityIDParameter)

func (*Handler) DeleteApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDNetworksNetworkID added in v0.1.46

func (h *Handler) DeleteApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDNetworksNetworkID(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, projectID openapi.ProjectIDParameter, identityID openapi.IdentityIDParameter, networkID openapi.NetworkIDParameter)

func (*Handler) DeleteApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDSecuritygroupsSecurityGroupID added in v0.1.45

func (h *Handler) DeleteApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDSecuritygroupsSecurityGroupID(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, projectID openapi.ProjectIDParameter, identityID openapi.IdentityIDParameter, securityGroupID openapi.SecurityGroupIDParameter)

func (*Handler) DeleteApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDServersServerID added in v0.1.46

func (h *Handler) DeleteApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDServersServerID(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, projectID openapi.ProjectIDParameter, identityID openapi.IdentityIDParameter, serverID openapi.ServerIDParameter)

func (*Handler) DeleteApiV2FilestorageFilestorageID added in v1.12.0

func (h *Handler) DeleteApiV2FilestorageFilestorageID(w http.ResponseWriter, r *http.Request, filestorageID openapi.FilestorageIDParameter)

func (*Handler) DeleteApiV2LoadbalancersLoadBalancerID added in v1.16.1

func (h *Handler) DeleteApiV2LoadbalancersLoadBalancerID(w http.ResponseWriter, r *http.Request, loadBalancerID openapi.LoadBalancerIDParameter)

func (*Handler) DeleteApiV2NetworksNetworkID added in v1.11.0

func (h *Handler) DeleteApiV2NetworksNetworkID(w http.ResponseWriter, r *http.Request, networkID openapi.NetworkIDParameter)

func (*Handler) DeleteApiV2NetworksNetworkIDReferencesReference added in v1.16.0

func (h *Handler) DeleteApiV2NetworksNetworkIDReferencesReference(w http.ResponseWriter, r *http.Request, networkID openapi.NetworkIDParameter, reference openapi.ReferenceParameter)

func (*Handler) DeleteApiV2SecuritygroupsSecurityGroupID added in v1.11.0

func (h *Handler) DeleteApiV2SecuritygroupsSecurityGroupID(w http.ResponseWriter, r *http.Request, securityGroupID openapi.SecurityGroupIDParameter)

func (*Handler) DeleteApiV2SshcertificateauthoritiesSshCertificateAuthorityID added in v1.16.0

func (h *Handler) DeleteApiV2SshcertificateauthoritiesSshCertificateAuthorityID(w http.ResponseWriter, r *http.Request, sshCertificateAuthorityID openapi.SshCertificateAuthorityIDParameter)

func (*Handler) GetApiV1OrganizationsOrganizationIDIdentities added in v0.1.19

func (h *Handler) GetApiV1OrganizationsOrganizationIDIdentities(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter)

func (*Handler) GetApiV1OrganizationsOrganizationIDNetworks added in v0.1.46

func (h *Handler) GetApiV1OrganizationsOrganizationIDNetworks(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter)

func (*Handler) GetApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityID added in v0.1.33

func (h *Handler) GetApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityID(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, projectID openapi.ProjectIDParameter, identityID openapi.IdentityIDParameter)

func (*Handler) GetApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDNetworksNetworkID added in v0.1.46

func (h *Handler) GetApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDNetworksNetworkID(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, projectID openapi.ProjectIDParameter, identityID openapi.IdentityIDParameter, networkID openapi.NetworkIDParameter)

func (*Handler) GetApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDSecuritygroupsSecurityGroupID added in v0.1.45

func (h *Handler) GetApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDSecuritygroupsSecurityGroupID(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, projectID openapi.ProjectIDParameter, identityID openapi.IdentityIDParameter, securityGroupID openapi.SecurityGroupIDParameter)

func (*Handler) GetApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDServersServerID added in v0.1.46

func (h *Handler) GetApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDServersServerID(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, projectID openapi.ProjectIDParameter, identityID openapi.IdentityIDParameter, serverID openapi.ServerIDParameter)

func (*Handler) GetApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDServersServerIDConsolesessions added in v1.8.0

func (h *Handler) GetApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDServersServerIDConsolesessions(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, projectID openapi.ProjectIDParameter, identityID openapi.IdentityIDParameter, serverID openapi.ServerIDParameter)

func (*Handler) GetApiV1OrganizationsOrganizationIDRegions added in v0.1.8

func (h *Handler) GetApiV1OrganizationsOrganizationIDRegions(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter)

func (*Handler) GetApiV1OrganizationsOrganizationIDRegionsRegionIDDetail added in v0.1.53

func (h *Handler) GetApiV1OrganizationsOrganizationIDRegionsRegionIDDetail(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, regionID openapi.RegionIDParameter)

func (*Handler) GetApiV1OrganizationsOrganizationIDRegionsRegionIDExternalnetworks added in v0.1.8

func (h *Handler) GetApiV1OrganizationsOrganizationIDRegionsRegionIDExternalnetworks(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, regionID openapi.RegionIDParameter)

func (*Handler) GetApiV1OrganizationsOrganizationIDRegionsRegionIDFlavors added in v0.1.8

func (h *Handler) GetApiV1OrganizationsOrganizationIDRegionsRegionIDFlavors(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, regionID openapi.RegionIDParameter)

func (*Handler) GetApiV1OrganizationsOrganizationIDSecuritygroups added in v0.1.45

func (h *Handler) GetApiV1OrganizationsOrganizationIDSecuritygroups(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, params openapi.GetApiV1OrganizationsOrganizationIDSecuritygroupsParams)

func (*Handler) GetApiV1OrganizationsOrganizationIDServers added in v0.1.46

func (h *Handler) GetApiV1OrganizationsOrganizationIDServers(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, params openapi.GetApiV1OrganizationsOrganizationIDServersParams)

func (*Handler) GetApiV2Filestorage added in v1.11.0

func (h *Handler) GetApiV2Filestorage(w http.ResponseWriter, r *http.Request, params openapi.GetApiV2FilestorageParams)

func (*Handler) GetApiV2FilestorageFilestorageID added in v1.12.0

func (h *Handler) GetApiV2FilestorageFilestorageID(w http.ResponseWriter, r *http.Request, filestorageID openapi.FilestorageIDParameter)

func (*Handler) GetApiV2Filestorageclasses added in v1.12.0

func (h *Handler) GetApiV2Filestorageclasses(w http.ResponseWriter, r *http.Request, params openapi.GetApiV2FilestorageclassesParams)

func (*Handler) GetApiV2Loadbalancers added in v1.16.1

func (h *Handler) GetApiV2Loadbalancers(w http.ResponseWriter, r *http.Request, params openapi.GetApiV2LoadbalancersParams)

func (*Handler) GetApiV2LoadbalancersLoadBalancerID added in v1.16.1

func (h *Handler) GetApiV2LoadbalancersLoadBalancerID(w http.ResponseWriter, r *http.Request, loadBalancerID openapi.LoadBalancerIDParameter)

func (*Handler) GetApiV2Networks added in v1.11.0

func (h *Handler) GetApiV2Networks(w http.ResponseWriter, r *http.Request, params openapi.GetApiV2NetworksParams)

func (*Handler) GetApiV2NetworksNetworkID added in v1.11.0

func (h *Handler) GetApiV2NetworksNetworkID(w http.ResponseWriter, r *http.Request, networkID openapi.NetworkIDParameter)

func (*Handler) GetApiV2Securitygroups added in v1.11.0

func (h *Handler) GetApiV2Securitygroups(w http.ResponseWriter, r *http.Request, params openapi.GetApiV2SecuritygroupsParams)

func (*Handler) GetApiV2SecuritygroupsSecurityGroupID added in v1.11.0

func (h *Handler) GetApiV2SecuritygroupsSecurityGroupID(w http.ResponseWriter, r *http.Request, securityGroupID openapi.SecurityGroupIDParameter)

func (*Handler) GetApiV2Sshcertificateauthorities added in v1.16.0

func (h *Handler) GetApiV2Sshcertificateauthorities(w http.ResponseWriter, r *http.Request, params openapi.GetApiV2SshcertificateauthoritiesParams)

func (*Handler) GetApiV2SshcertificateauthoritiesSshCertificateAuthorityID added in v1.16.0

func (h *Handler) GetApiV2SshcertificateauthoritiesSshCertificateAuthorityID(w http.ResponseWriter, r *http.Request, sshCertificateAuthorityID openapi.SshCertificateAuthorityIDParameter)

func (*Handler) GetWellKnownOpenidProtectedResource added in v1.14.0

func (h *Handler) GetWellKnownOpenidProtectedResource(w http.ResponseWriter, r *http.Request)

GetWellKnownOpenidProtectedResource implements RFC 9728.

func (*Handler) PostApiV1OrganizationsOrganizationIDProjectsProjectIDIdentities added in v0.1.21

func (h *Handler) PostApiV1OrganizationsOrganizationIDProjectsProjectIDIdentities(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, projectID openapi.ProjectIDParameter)

func (*Handler) PostApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDNetworks added in v0.1.46

func (h *Handler) PostApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDNetworks(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, projectID openapi.ProjectIDParameter, identityID openapi.IdentityIDParameter)

func (*Handler) PostApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDSecuritygroups added in v0.1.45

func (h *Handler) PostApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDSecuritygroups(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, projectID openapi.ProjectIDParameter, identityID openapi.IdentityIDParameter)

func (*Handler) PostApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDServers added in v0.1.46

func (h *Handler) PostApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDServers(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, projectID openapi.ProjectIDParameter, identityID openapi.IdentityIDParameter)

func (*Handler) PostApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDServersServerIDHardreboot added in v1.7.0

func (h *Handler) PostApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDServersServerIDHardreboot(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, projectID openapi.ProjectIDParameter, identityID openapi.IdentityIDParameter, serverID openapi.ServerIDParameter)

func (*Handler) PostApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDServersServerIDSoftreboot added in v1.7.0

func (h *Handler) PostApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDServersServerIDSoftreboot(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, projectID openapi.ProjectIDParameter, identityID openapi.IdentityIDParameter, serverID openapi.ServerIDParameter)

func (*Handler) PostApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDServersServerIDStart added in v1.7.0

func (h *Handler) PostApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDServersServerIDStart(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, projectID openapi.ProjectIDParameter, identityID openapi.IdentityIDParameter, serverID openapi.ServerIDParameter)

func (*Handler) PostApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDServersServerIDStop added in v1.7.0

func (h *Handler) PostApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDServersServerIDStop(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, projectID openapi.ProjectIDParameter, identityID openapi.IdentityIDParameter, serverID openapi.ServerIDParameter)

func (*Handler) PostApiV2Filestorage added in v1.11.0

func (h *Handler) PostApiV2Filestorage(w http.ResponseWriter, r *http.Request)

func (*Handler) PostApiV2Loadbalancers added in v1.16.1

func (h *Handler) PostApiV2Loadbalancers(w http.ResponseWriter, r *http.Request)

func (*Handler) PostApiV2Networks added in v1.11.0

func (h *Handler) PostApiV2Networks(w http.ResponseWriter, r *http.Request)

func (*Handler) PostApiV2Securitygroups added in v1.11.0

func (h *Handler) PostApiV2Securitygroups(w http.ResponseWriter, r *http.Request)

func (*Handler) PostApiV2Sshcertificateauthorities added in v1.16.0

func (h *Handler) PostApiV2Sshcertificateauthorities(w http.ResponseWriter, r *http.Request)

func (*Handler) PutApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDSecuritygroupsSecurityGroupID added in v0.1.45

func (h *Handler) PutApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDSecuritygroupsSecurityGroupID(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, projectID openapi.ProjectIDParameter, identityID openapi.IdentityIDParameter, securityGroupID openapi.SecurityGroupIDParameter)

func (*Handler) PutApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDServersServerID added in v1.2.0

func (h *Handler) PutApiV1OrganizationsOrganizationIDProjectsProjectIDIdentitiesIdentityIDServersServerID(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, projectID openapi.ProjectIDParameter, identityID openapi.IdentityIDParameter, serverID openapi.ServerIDParameter)

func (*Handler) PutApiV2FilestorageFilestorageID added in v1.12.0

func (h *Handler) PutApiV2FilestorageFilestorageID(w http.ResponseWriter, r *http.Request, fileStorageID openapi.FilestorageIDParameter)

func (*Handler) PutApiV2LoadbalancersLoadBalancerID added in v1.16.1

func (h *Handler) PutApiV2LoadbalancersLoadBalancerID(w http.ResponseWriter, r *http.Request, loadBalancerID openapi.LoadBalancerIDParameter)

func (*Handler) PutApiV2NetworksNetworkID added in v1.11.0

func (h *Handler) PutApiV2NetworksNetworkID(w http.ResponseWriter, r *http.Request, networkID openapi.NetworkIDParameter)

func (*Handler) PutApiV2NetworksNetworkIDReferencesReference added in v1.16.0

func (h *Handler) PutApiV2NetworksNetworkIDReferencesReference(w http.ResponseWriter, r *http.Request, networkID openapi.NetworkIDParameter, reference openapi.ReferenceParameter)

func (*Handler) PutApiV2SecuritygroupsSecurityGroupID added in v1.11.0

func (h *Handler) PutApiV2SecuritygroupsSecurityGroupID(w http.ResponseWriter, r *http.Request, securityGroupID openapi.SecurityGroupIDParameter)

type ImageHandler added in v1.12.0

type ImageHandler struct {
	common.ClientArgs
	// contains filtered or unexported fields
}

func NewImageHandler added in v1.12.0

func NewImageHandler(clientArgs common.ClientArgs, options *Options) *ImageHandler

func (*ImageHandler) DeleteApiV1OrganizationsOrganizationIDRegionsRegionIDImagesImageID added in v1.12.0

func (h *ImageHandler) DeleteApiV1OrganizationsOrganizationIDRegionsRegionIDImagesImageID(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, regionID openapi.RegionIDParameter, imageID openapi.ImageIDParameter)

func (*ImageHandler) GetApiV1OrganizationsOrganizationIDRegionsRegionIDImages added in v1.12.0

func (h *ImageHandler) GetApiV1OrganizationsOrganizationIDRegionsRegionIDImages(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, regionID openapi.RegionIDParameter)

func (*ImageHandler) PostApiV1OrganizationsOrganizationIDRegionsRegionIDImages added in v1.12.0

func (h *ImageHandler) PostApiV1OrganizationsOrganizationIDRegionsRegionIDImages(w http.ResponseWriter, r *http.Request, organizationID openapi.OrganizationIDParameter, regionID openapi.RegionIDParameter)

type ImageV2Handler added in v1.14.0

type ImageV2Handler struct {
	common.ClientArgs
	// contains filtered or unexported fields
}

func NewImageV2Handler added in v1.14.0

func NewImageV2Handler(clientArgs common.ClientArgs, options *Options) *ImageV2Handler

func (*ImageV2Handler) GetApiV2RegionsRegionIDImages added in v1.14.0

func (h *ImageV2Handler) GetApiV2RegionsRegionIDImages(w http.ResponseWriter, r *http.Request, regionID openapi.RegionIDParameter, params openapi.GetApiV2RegionsRegionIDImagesParams)

type Options

type Options struct {
	// cacheMaxAge defines the max age for cachable items e.g. images and
	// flavors don't change all that often.
	CacheMaxAge time.Duration

	// ImageUploadSizeLimit defines the maximum size for image uploads in bytes.
	ImageUploadSizeLimit int64
}

Options defines configurable handler options.

func (*Options) AddFlags

func (o *Options) AddFlags(f *pflag.FlagSet)

AddFlags adds the options flags to the given flag set.

type ServerV2Handler added in v1.13.0

type ServerV2Handler struct {
	common.ClientArgs
}

func NewServerV2Handler added in v1.13.0

func NewServerV2Handler(clientArgs common.ClientArgs) *ServerV2Handler

func (*ServerV2Handler) DeleteApiV2ServersServerID added in v1.13.0

func (h *ServerV2Handler) DeleteApiV2ServersServerID(w http.ResponseWriter, r *http.Request, serverID openapi.ServerIDParameter)

func (*ServerV2Handler) GetApiV2Servers added in v1.13.0

func (h *ServerV2Handler) GetApiV2Servers(w http.ResponseWriter, r *http.Request, params openapi.GetApiV2ServersParams)

func (*ServerV2Handler) GetApiV2ServersServerID added in v1.13.0

func (h *ServerV2Handler) GetApiV2ServersServerID(w http.ResponseWriter, r *http.Request, serverID openapi.ServerIDParameter)

func (*ServerV2Handler) GetApiV2ServersServerIDConsoleoutput added in v1.13.0

func (h *ServerV2Handler) GetApiV2ServersServerIDConsoleoutput(w http.ResponseWriter, r *http.Request, serverID openapi.ServerIDParameter, params openapi.GetApiV2ServersServerIDConsoleoutputParams)

func (*ServerV2Handler) GetApiV2ServersServerIDConsolesessions added in v1.13.0

func (h *ServerV2Handler) GetApiV2ServersServerIDConsolesessions(w http.ResponseWriter, r *http.Request, serverID openapi.ServerIDParameter)

func (*ServerV2Handler) GetApiV2ServersServerIDSshkey added in v1.13.0

func (h *ServerV2Handler) GetApiV2ServersServerIDSshkey(w http.ResponseWriter, r *http.Request, serverID openapi.ServerIDParameter)

func (*ServerV2Handler) PostApiV2Servers added in v1.13.0

func (h *ServerV2Handler) PostApiV2Servers(w http.ResponseWriter, r *http.Request)

func (*ServerV2Handler) PostApiV2ServersServerIDHardreboot added in v1.13.0

func (h *ServerV2Handler) PostApiV2ServersServerIDHardreboot(w http.ResponseWriter, r *http.Request, serverID openapi.ServerIDParameter)

func (*ServerV2Handler) PostApiV2ServersServerIDSnapshot added in v1.13.0

func (h *ServerV2Handler) PostApiV2ServersServerIDSnapshot(w http.ResponseWriter, r *http.Request, serverID openapi.ServerIDParameter)

func (*ServerV2Handler) PostApiV2ServersServerIDSoftreboot added in v1.13.0

func (h *ServerV2Handler) PostApiV2ServersServerIDSoftreboot(w http.ResponseWriter, r *http.Request, serverID openapi.ServerIDParameter)

func (*ServerV2Handler) PostApiV2ServersServerIDStart added in v1.13.0

func (h *ServerV2Handler) PostApiV2ServersServerIDStart(w http.ResponseWriter, r *http.Request, serverID openapi.ServerIDParameter)

func (*ServerV2Handler) PostApiV2ServersServerIDStop added in v1.13.0

func (h *ServerV2Handler) PostApiV2ServersServerIDStop(w http.ResponseWriter, r *http.Request, serverID openapi.ServerIDParameter)

func (*ServerV2Handler) PutApiV2ServersServerID added in v1.13.0

func (h *ServerV2Handler) PutApiV2ServersServerID(w http.ResponseWriter, r *http.Request, serverID openapi.ServerIDParameter)

Directories

Path Synopsis
mock
Code generated by MockGen.
Code generated by MockGen.
mock
Code generated by MockGen.
Code generated by MockGen.
mock
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

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