instance

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: Apache-2.0 Imports: 14 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.4.0 DO NOT EDIT.

Index

Constants

View Source
const (
	BearerAuthScopes = "BearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func NewCreateRequest added in v1.4.0

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 added in v1.4.0

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 added in v1.4.0

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

NewDeleteRequest generates requests for Delete

func NewGetRequest added in v1.4.0

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

NewGetRequest generates requests for Get

func NewListRequest added in v1.4.0

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

NewListRequest generates requests for List

func NewPatchUpdateRequest added in v1.4.0

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

NewPatchUpdateRequest calls the generic PatchUpdate builder with application/json body

func NewPatchUpdateRequestWithBody added in v1.4.0

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

NewPatchUpdateRequestWithBody generates requests for PatchUpdate with any type of body

func NewUpdateRequest added in v1.4.0

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

NewUpdateRequest calls the generic Update builder with application/json body

func NewUpdateRequestWithBody added in v1.4.0

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

NewUpdateRequestWithBody generates requests for Update 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 added in v1.4.0

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

func (*Client) CreateWithBody added in v1.4.0

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

func (*Client) Delete added in v1.4.0

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

func (*Client) Get added in v1.4.0

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

func (*Client) List added in v1.4.0

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

func (*Client) PatchUpdate added in v1.4.0

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

func (*Client) PatchUpdateWithBody added in v1.4.0

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

func (*Client) Update added in v1.4.0

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

func (*Client) UpdateWithBody added in v1.4.0

func (c *Client) UpdateWithBody(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, 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)

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

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

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

	Update(ctx context.Context, projectID string, instanceID string, body UpdateJSONRequestBody, 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 added in v1.4.0

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 added in v1.4.0

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

func (*ClientWithResponses) DeleteWithResponse added in v1.4.0

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

DeleteWithResponse request returning *DeleteResponse

func (*ClientWithResponses) GetWithResponse added in v1.4.0

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

GetWithResponse request returning *GetResponse

func (*ClientWithResponses) ListWithResponse added in v1.4.0

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

ListWithResponse request returning *ListResponse

func (*ClientWithResponses) ParseCreateResponse added in v1.4.0

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

ParseCreateResponse parses an HTTP response from a CreateWithResponse call

func (*ClientWithResponses) ParseDeleteResponse added in v1.4.0

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

ParseDeleteResponse parses an HTTP response from a DeleteWithResponse call

func (*ClientWithResponses) ParseGetResponse added in v1.4.0

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

ParseGetResponse parses an HTTP response from a GetWithResponse call

func (*ClientWithResponses) ParseListResponse added in v1.4.0

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

ParseListResponse parses an HTTP response from a ListWithResponse call

func (*ClientWithResponses) ParsePatchUpdateResponse added in v1.4.0

func (c *ClientWithResponses) ParsePatchUpdateResponse(rsp *http.Response) (*PatchUpdateResponse, error)

ParsePatchUpdateResponse parses an HTTP response from a PatchUpdateWithResponse call

func (*ClientWithResponses) ParseUpdateResponse added in v1.4.0

func (c *ClientWithResponses) ParseUpdateResponse(rsp *http.Response) (*UpdateResponse, error)

ParseUpdateResponse parses an HTTP response from a UpdateWithResponse call

func (*ClientWithResponses) PatchUpdateWithBodyWithResponse added in v1.4.0

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

PatchUpdateWithBodyWithResponse request with arbitrary body returning *PatchUpdateResponse

func (*ClientWithResponses) PatchUpdateWithResponse added in v1.4.0

func (c *ClientWithResponses) PatchUpdateWithResponse(ctx context.Context, projectID string, instanceID string, body PatchUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchUpdateResponse, error)

func (*ClientWithResponses) UpdateWithBodyWithResponse added in v1.4.0

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

UpdateWithBodyWithResponse request with arbitrary body returning *UpdateResponse

func (*ClientWithResponses) UpdateWithResponse added in v1.4.0

func (c *ClientWithResponses) UpdateWithResponse(ctx context.Context, projectID string, instanceID string, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// List request
	ListWithResponse(ctx context.Context, projectID string, 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)

	// PatchUpdate request with any body
	PatchUpdateWithBodyWithResponse(ctx context.Context, projectID string, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchUpdateResponse, error)

	PatchUpdateWithResponse(ctx context.Context, projectID string, instanceID string, body PatchUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchUpdateResponse, error)

	// Update request with any body
	UpdateWithBodyWithResponse(ctx context.Context, projectID string, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateResponse, error)

	UpdateWithResponse(ctx context.Context, projectID string, instanceID string, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateResponse, error)
}

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

type CreateJSONRequestBody added in v1.4.0

type CreateJSONRequestBody = InstanceCreateInstanceRequest

CreateJSONRequestBody defines body for Create for application/json ContentType.

type CreateResponse added in v1.4.0

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

func (CreateResponse) Status added in v1.4.0

func (r CreateResponse) Status() string

Status returns HTTPResponse.Status

func (CreateResponse) StatusCode added in v1.4.0

func (r CreateResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

func (CreateResponse) WaitHandler added in v1.4.0

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 added in v1.4.0

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

func (DeleteResponse) Status added in v1.4.0

func (r DeleteResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteResponse) StatusCode added in v1.4.0

func (r DeleteResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

func (DeleteResponse) WaitHandler added in v1.4.0

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 added in v1.4.0

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

func (GetResponse) Status added in v1.4.0

func (r GetResponse) Status() string

Status returns HTTPResponse.Status

func (GetResponse) StatusCode added in v1.4.0

func (r GetResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type InstanceACL added in v1.5.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  *map[string]string `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 InstanceGetInstanceResponse

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

InstanceGetInstanceResponse defines model for instance.GetInstanceResponse.

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"`
	Status         *string            `json:"status,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 ListResponse added in v1.4.0

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

func (ListResponse) Status added in v1.4.0

func (r ListResponse) Status() string

Status returns HTTPResponse.Status

func (ListResponse) StatusCode added in v1.4.0

func (r ListResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PatchUpdateJSONRequestBody added in v1.4.0

type PatchUpdateJSONRequestBody = InstanceUpdateInstanceRequest

PatchUpdateJSONRequestBody defines body for PatchUpdate for application/json ContentType.

type PatchUpdateResponse added in v1.4.0

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

func (PatchUpdateResponse) Status added in v1.4.0

func (r PatchUpdateResponse) Status() string

Status returns HTTPResponse.Status

func (PatchUpdateResponse) StatusCode added in v1.4.0

func (r PatchUpdateResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type UpdateJSONRequestBody added in v1.4.0

type UpdateJSONRequestBody = InstanceUpdateInstanceRequest

UpdateJSONRequestBody defines body for Update for application/json ContentType.

type UpdateResponse added in v1.4.0

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

func (UpdateResponse) Status added in v1.4.0

func (r UpdateResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateResponse) StatusCode added in v1.4.0

func (r UpdateResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

func (UpdateResponse) WaitHandler added in v1.4.0

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

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

Jump to

Keyboard shortcuts

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