instance

package
v1.14.7 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package instance provides primitives to interact with the openapi HTTP API.

Code generated by github.com/do87/oapi-codegen version v0.5.1 DO NOT EDIT.

Index

Constants

View Source
const (
	// Instance status options
	STATUS_READY      = "READY"
	STATUS_FAILED     = "FAILED"
	STATUS_PROCESSING = "PROCESSING"
	STATUS_UNKNOWN    = "UNKNOWN"
)
View Source
const (
	BearerAuthScopes = "BearerAuth.Scopes"
)
View Source
const ClientTimeoutErr = "Client.Timeout exceeded while awaiting headers"

Variables

This section is empty.

Functions

func NewCreateRequest

func NewCreateRequest(ctx context.Context, server string, projectID string, body CreateJSONRequestBody) (*http.Request, error)

NewCreateRequest calls the generic Create builder with application/json body

func NewCreateRequestWithBody

func NewCreateRequestWithBody(ctx context.Context, server string, projectID string, contentType string, body io.Reader) (*http.Request, error)

NewCreateRequestWithBody generates requests for Create with any type of body

func NewDeleteRequest

func NewDeleteRequest(ctx context.Context, server string, projectID string, instanceID string) (*http.Request, error)

NewDeleteRequest generates requests for Delete

func NewGetRequest

func NewGetRequest(ctx context.Context, server string, projectID string, instanceID string) (*http.Request, error)

NewGetRequest generates requests for Get

func NewListRequest

func NewListRequest(ctx context.Context, server string, projectID string, params *ListParams) (*http.Request, error)

NewListRequest generates requests for List

func NewPatchRequest

func NewPatchRequest(ctx context.Context, server string, projectID string, instanceID string, body PatchJSONRequestBody) (*http.Request, error)

NewPatchRequest calls the generic Patch builder with application/json body

func NewPatchRequestWithBody

func NewPatchRequestWithBody(ctx context.Context, server string, projectID string, instanceID string, contentType string, body io.Reader) (*http.Request, error)

NewPatchRequestWithBody generates requests for Patch with any type of body

func NewPutRequest

func NewPutRequest(ctx context.Context, server string, projectID string, instanceID string, body PutJSONRequestBody) (*http.Request, error)

NewPutRequest calls the generic Put builder with application/json body

func NewPutRequestWithBody

func NewPutRequestWithBody(ctx context.Context, server string, projectID string, instanceID string, contentType string, body io.Reader) (*http.Request, error)

NewPutRequestWithBody generates requests for Put with any type of body

Types

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client common.Client
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, httpClient common.Client) *Client

Creates a new Client, with reasonable defaults

func (*Client) Create

func (c *Client) Create(ctx context.Context, projectID string, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateWithBody

func (c *Client) CreateWithBody(ctx context.Context, projectID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, projectID string, instanceID string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Get

func (c *Client) Get(ctx context.Context, projectID string, instanceID string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) List

func (c *Client) List(ctx context.Context, projectID string, params *ListParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Patch

func (c *Client) Patch(ctx context.Context, projectID string, instanceID string, body PatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PatchWithBody

func (c *Client) PatchWithBody(ctx context.Context, projectID string, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Put

func (c *Client) Put(ctx context.Context, projectID string, instanceID string, body PutJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PutWithBody

func (c *Client) PutWithBody(ctx context.Context, projectID string, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// List request
	List(ctx context.Context, projectID string, params *ListParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Create request with any body
	CreateWithBody(ctx context.Context, projectID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	Create(ctx context.Context, projectID string, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Delete request
	Delete(ctx context.Context, projectID string, instanceID string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Get request
	Get(ctx context.Context, projectID string, instanceID string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Patch request with any body
	PatchWithBody(ctx context.Context, projectID string, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	Patch(ctx context.Context, projectID string, instanceID string, body PatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Put request with any body
	PutWithBody(ctx context.Context, projectID string, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	Put(ctx context.Context, projectID string, instanceID string, body PutJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, httpClient common.Client) *ClientWithResponses

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) CreateWithBodyWithResponse

func (c *ClientWithResponses) CreateWithBodyWithResponse(ctx context.Context, projectID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateResponse, error)

CreateWithBodyWithResponse request with arbitrary body returning *CreateResponse

func (*ClientWithResponses) CreateWithResponse

func (c *ClientWithResponses) CreateWithResponse(ctx context.Context, projectID string, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateResponse, error)

func (*ClientWithResponses) DeleteWithResponse

func (c *ClientWithResponses) DeleteWithResponse(ctx context.Context, projectID string, instanceID string, reqEditors ...RequestEditorFn) (*DeleteResponse, error)

DeleteWithResponse request returning *DeleteResponse

func (*ClientWithResponses) GetWithResponse

func (c *ClientWithResponses) GetWithResponse(ctx context.Context, projectID string, instanceID string, reqEditors ...RequestEditorFn) (*GetResponse, error)

GetWithResponse request returning *GetResponse

func (*ClientWithResponses) ListWithResponse

func (c *ClientWithResponses) ListWithResponse(ctx context.Context, projectID string, params *ListParams, reqEditors ...RequestEditorFn) (*ListResponse, error)

ListWithResponse request returning *ListResponse

func (*ClientWithResponses) ParseCreateResponse

func (c *ClientWithResponses) ParseCreateResponse(rsp *http.Response) (*CreateResponse, error)

ParseCreateResponse parses an HTTP response from a CreateWithResponse call

func (*ClientWithResponses) ParseDeleteResponse

func (c *ClientWithResponses) ParseDeleteResponse(rsp *http.Response) (*DeleteResponse, error)

ParseDeleteResponse parses an HTTP response from a DeleteWithResponse call

func (*ClientWithResponses) ParseGetResponse

func (c *ClientWithResponses) ParseGetResponse(rsp *http.Response) (*GetResponse, error)

ParseGetResponse parses an HTTP response from a GetWithResponse call

func (*ClientWithResponses) ParseListResponse

func (c *ClientWithResponses) ParseListResponse(rsp *http.Response) (*ListResponse, error)

ParseListResponse parses an HTTP response from a ListWithResponse call

func (*ClientWithResponses) ParsePatchResponse

func (c *ClientWithResponses) ParsePatchResponse(rsp *http.Response) (*PatchResponse, error)

ParsePatchResponse parses an HTTP response from a PatchWithResponse call

func (*ClientWithResponses) ParsePutResponse

func (c *ClientWithResponses) ParsePutResponse(rsp *http.Response) (*PutResponse, error)

ParsePutResponse parses an HTTP response from a PutWithResponse call

func (*ClientWithResponses) PatchWithBodyWithResponse

func (c *ClientWithResponses) PatchWithBodyWithResponse(ctx context.Context, projectID string, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchResponse, error)

PatchWithBodyWithResponse request with arbitrary body returning *PatchResponse

func (*ClientWithResponses) PatchWithResponse

func (c *ClientWithResponses) PatchWithResponse(ctx context.Context, projectID string, instanceID string, body PatchJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchResponse, error)

func (*ClientWithResponses) PutWithBodyWithResponse

func (c *ClientWithResponses) PutWithBodyWithResponse(ctx context.Context, projectID string, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutResponse, error)

PutWithBodyWithResponse request with arbitrary body returning *PutResponse

func (*ClientWithResponses) PutWithResponse

func (c *ClientWithResponses) PutWithResponse(ctx context.Context, projectID string, instanceID string, body PutJSONRequestBody, reqEditors ...RequestEditorFn) (*PutResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// List request
	ListWithResponse(ctx context.Context, projectID string, params *ListParams, reqEditors ...RequestEditorFn) (*ListResponse, error)

	// Create request with any body
	CreateWithBodyWithResponse(ctx context.Context, projectID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateResponse, error)

	CreateWithResponse(ctx context.Context, projectID string, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateResponse, error)

	// Delete request
	DeleteWithResponse(ctx context.Context, projectID string, instanceID string, reqEditors ...RequestEditorFn) (*DeleteResponse, error)

	// Get request
	GetWithResponse(ctx context.Context, projectID string, instanceID string, reqEditors ...RequestEditorFn) (*GetResponse, error)

	// Patch request with any body
	PatchWithBodyWithResponse(ctx context.Context, projectID string, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchResponse, error)

	PatchWithResponse(ctx context.Context, projectID string, instanceID string, body PatchJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchResponse, error)

	// Put request with any body
	PutWithBodyWithResponse(ctx context.Context, projectID string, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutResponse, error)

	PutWithResponse(ctx context.Context, projectID string, instanceID string, body PutJSONRequestBody, reqEditors ...RequestEditorFn) (*PutResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CreateJSONRequestBody

type CreateJSONRequestBody = InstanceCreateInstanceRequest

CreateJSONRequestBody defines body for Create for application/json ContentType.

type CreateResponse

type CreateResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *InstanceCreateInstanceResponse
	JSON400      *InstanceError
	JSON404      *InstanceError
	JSON500      *InstanceError
	HasError     error // Aggregated error
}

func (CreateResponse) Status

func (r CreateResponse) Status() string

Status returns HTTPResponse.Status

func (CreateResponse) StatusCode

func (r CreateResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

func (CreateResponse) WaitHandler

func (r CreateResponse) WaitHandler(ctx context.Context, c *ClientWithResponses, projectID, instanceID string) *wait.Handler

WaitHandler will wait for instance creation to complete returned interface is of *InstanceSingleInstance

type DeleteResponse

type DeleteResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *InstanceError
	JSON404      *InstanceError
	JSON500      *InstanceError
	HasError     error // Aggregated error
}

func (DeleteResponse) Status

func (r DeleteResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteResponse) StatusCode

func (r DeleteResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

func (DeleteResponse) WaitHandler

func (r DeleteResponse) WaitHandler(ctx context.Context, c *ClientWithResponses, projectID, instanceID string) *wait.Handler

WaitHandler will wait for instance deletion returned value for deletion wait will always be nil

type GetResponse

type GetResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *InstancesGetInstanceResponse
	JSON400      *InstanceError
	JSON500      *InstanceError
	HasError     error // Aggregated error
}

func (GetResponse) Status

func (r GetResponse) Status() string

Status returns HTTPResponse.Status

func (GetResponse) StatusCode

func (r GetResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type InstanceACL added in v1.8.1

type InstanceACL struct {
	// Items TODO validating in api (middleware)
	Items *[]string `json:"items,omitempty"`
}

InstanceACL defines model for instance.ACL.

type InstanceCreateInstanceRequest

type InstanceCreateInstanceRequest struct {
	ACL            *InstanceACL `json:"acl,omitempty"`
	BackupSchedule *string      `json:"backupSchedule,omitempty"`
	FlavorID       *string      `json:"flavorId,omitempty"`

	// Labels Following fields are not certain/clear
	Labels  *map[string]string `json:"labels,omitempty"`
	Name    *string            `json:"name,omitempty"`
	Options *struct {
		// Type it must be one of "Single", "Replica", "Sharded"
		Type *string `json:"type,omitempty"`
	} `json:"options,omitempty"`
	Replicas *int             `json:"replicas,omitempty"`
	Storage  *InstanceStorage `json:"storage,omitempty"`
	Version  *string          `json:"version,omitempty"`
}

InstanceCreateInstanceRequest defines model for instance.CreateInstanceRequest.

type InstanceCreateInstanceResponse

type InstanceCreateInstanceResponse struct {
	ID *string `json:"id,omitempty"`
}

InstanceCreateInstanceResponse defines model for instance.CreateInstanceResponse.

type InstanceError

type InstanceError struct {
	Code    *int                 `json:"code,omitempty"`
	Fields  *map[string][]string `json:"fields,omitempty"`
	Message *string              `json:"message,omitempty"`
	Type    *string              `json:"type,omitempty"`
}

InstanceError defines model for instance.Error.

type InstanceFlavor

type InstanceFlavor struct {
	CPU         *int    `json:"cpu,omitempty"`
	Description *string `json:"description,omitempty"`
	ID          *string `json:"id,omitempty"`
	Memory      *int    `json:"memory,omitempty"`
}

InstanceFlavor defines model for instance.Flavor.

type InstanceListInstance

type InstanceListInstance struct {
	ID     *string `json:"id,omitempty"`
	Name   *string `json:"name,omitempty"`
	Status *string `json:"status,omitempty"`
}

InstanceListInstance defines model for instance.ListInstance.

type InstanceListInstanceResponse

type InstanceListInstanceResponse struct {
	// Count TODO pagination ?
	Count *int                    `json:"count,omitempty"`
	Items *[]InstanceListInstance `json:"items,omitempty"`
}

InstanceListInstanceResponse defines model for instance.ListInstanceResponse.

type InstanceSingleInstance

type InstanceSingleInstance struct {
	ACL            *InstanceACL       `json:"acl,omitempty"`
	BackupSchedule *string            `json:"backupSchedule,omitempty"`
	Flavor         *InstanceFlavor    `json:"flavor,omitempty"`
	ID             *string            `json:"id,omitempty"`
	Name           *string            `json:"name,omitempty"`
	Options        *map[string]string `json:"options,omitempty"`
	Replicas       *int               `json:"replicas,omitempty"`
	Storage        *InstanceStorage   `json:"storage,omitempty"`
	Version        *string            `json:"version,omitempty"`
}

InstanceSingleInstance defines model for instance.SingleInstance.

type InstanceStorage

type InstanceStorage struct {
	Class *string `json:"class,omitempty"`
	Size  *int    `json:"size,omitempty"`
}

InstanceStorage defines model for instance.Storage.

type InstanceUpdateInstanceRequest

type InstanceUpdateInstanceRequest struct {
	ACL            *InstanceACL `json:"acl,omitempty"`
	BackupSchedule *string      `json:"backupSchedule,omitempty"`
	FlavorID       *string      `json:"flavorId,omitempty"`

	// Labels Following fields are not certain/clear
	Labels   *map[string]string `json:"labels,omitempty"`
	Name     *string            `json:"name,omitempty"`
	Options  *map[string]string `json:"options,omitempty"`
	Replicas *int               `json:"replicas,omitempty"`
	Storage  *InstanceStorage   `json:"storage,omitempty"`
	Version  *string            `json:"version,omitempty"`
}

InstanceUpdateInstanceRequest defines model for instance.UpdateInstanceRequest.

type InstanceUpdateInstanceResponse

type InstanceUpdateInstanceResponse struct {
	Item *InstanceSingleInstance `json:"item,omitempty"`
}

InstanceUpdateInstanceResponse defines model for instance.UpdateInstanceResponse.

type InstancesGetInstanceResponse

type InstancesGetInstanceResponse struct {
	Item *InstancesSingleInstance `json:"item,omitempty"`
}

InstancesGetInstanceResponse defines model for instances.GetInstanceResponse.

type InstancesSingleInstance

type InstancesSingleInstance struct {
	ACL            *InstanceACL       `json:"acl,omitempty"`
	BackupSchedule *string            `json:"backupSchedule,omitempty"`
	Flavor         *InstanceFlavor    `json:"flavor,omitempty"`
	ID             *string            `json:"id,omitempty"`
	Name           *string            `json:"name,omitempty"`
	Options        *map[string]string `json:"options,omitempty"`
	Replicas       *int               `json:"replicas,omitempty"`
	Status         *string            `json:"status,omitempty"`
	Storage        *InstanceStorage   `json:"storage,omitempty"`
	Version        *string            `json:"version,omitempty"`
}

InstancesSingleInstance defines model for instances.SingleInstance.

type ListParams

type ListParams struct {
	// Tag instance tag
	Tag string `form:"tag" json:"tag"`
}

ListParams defines parameters for List.

type ListResponse

type ListResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *InstanceListInstanceResponse
	JSON400      *InstanceError
	JSON500      *InstanceError
	HasError     error // Aggregated error
}

func (ListResponse) Status

func (r ListResponse) Status() string

Status returns HTTPResponse.Status

func (ListResponse) StatusCode

func (r ListResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PatchJSONRequestBody

type PatchJSONRequestBody = InstanceUpdateInstanceRequest

PatchJSONRequestBody defines body for Patch for application/json ContentType.

type PatchResponse

type PatchResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *InstanceUpdateInstanceResponse
	JSON400      *InstanceError
	JSON404      *InstanceError
	JSON500      *InstanceError
	HasError     error // Aggregated error
}

func (PatchResponse) Status

func (r PatchResponse) Status() string

Status returns HTTPResponse.Status

func (PatchResponse) StatusCode

func (r PatchResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PutJSONRequestBody

type PutJSONRequestBody = InstanceUpdateInstanceRequest

PutJSONRequestBody defines body for Put for application/json ContentType.

type PutResponse

type PutResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *InstanceUpdateInstanceResponse
	JSON400      *InstanceError
	JSON404      *InstanceError
	JSON500      *InstanceError
	HasError     error // Aggregated error
}

func (PutResponse) Status

func (r PutResponse) Status() string

Status returns HTTPResponse.Status

func (PutResponse) StatusCode

func (r PutResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

func (PutResponse) WaitHandler

func (r PutResponse) WaitHandler(ctx context.Context, c *ClientWithResponses, projectID, instanceID string) *wait.Handler

WaitHandler will wait for instance update to complete returned interface is nil

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

Jump to

Keyboard shortcuts

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