api

package
v0.0.0-...-6c21669 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CloudErrorCodeInternalServerError                = "InternalServerError"
	CloudErrorCodeInvalidParameter                   = "InvalidParameter"
	CloudErrorCodeInvalidRequestContent              = "InvalidRequestContent"
	CloudErrorCodeInvalidResource                    = "InvalidResource"
	CloudErrorCodeInvalidResourceGroup               = "InvalidResourceGroup"
	CloudErrorCodeInvalidResourceNamespace           = "InvalidResourceNamespace"
	CloudErrorCodeInvalidResourceType                = "InvalidResourceType"
	CloudErrorCodeInvalidSubscriptionID              = "InvalidSubscriptionID"
	CloudErrorCodeMismatchingResourceID              = "MismatchingResourceID"
	CloudErrorCodeMismatchingResourceName            = "MismatchingResourceName"
	CloudErrorCodeMismatchingResourceType            = "MismatchingResourceType"
	CloudErrorCodePropertyChangeNotAllowed           = "PropertyChangeNotAllowed"
	CloudErrorCodeRequestNotAllowed                  = "RequestNotAllowed"
	CloudErrorCodeResourceGroupNotFound              = "ResourceGroupNotFound"
	CloudErrorCodeResourceNotFound                   = "ResourceNotFound"
	CloudErrorCodeUnsupportedMediaType               = "UnsupportedMediaType"
	CloudErrorCodeInvalidLinkedVNet                  = "InvalidLinkedVNet"
	CloudErrorCodeNotFound                           = "NotFound"
	CloudErrorCodeForbidden                          = "Forbidden"
	CloudErrorCodeInvalidSubscriptionState           = "InvalidSubscriptionState"
	CloudErrorCodeInvalidServicePrincipalCredentials = "InvalidServicePrincipalCredentials"
	CloudErrorCodeInvalidResourceProviderPermissions = "InvalidResourceProviderPermissions"
	CloudErrorCodeInvalidServicePrincipalPermissions = "InvalidServicePrincipalPermissions"
	CloudErrorCodeInvalidLocation                    = "InvalidLocation"
	CloudErrorCodeInvalidOperationID                 = "InvalidOperationID"
)

CloudErrorCodes

View Source
var APIs = map[string]*Version{}

APIs is the map of registered API versions

Functions

func AddExtensions

func AddExtensions(h *codec.BasicHandle) error

AddExtensions adds extensions to a ugorji/go/codec to enable it to serialise our types properly

func WriteCloudError

func WriteCloudError(w http.ResponseWriter, err *CloudError)

WriteCloudError writes a CloudError to the given ResponseWriter

func WriteError

func WriteError(w http.ResponseWriter, statusCode int, code, target, message string, a ...interface{})

WriteError constructs and writes a CloudError to the given ResponseWriter

Types

type APIServerProfile

type APIServerProfile struct {
	MissingFields

	Visibility Visibility `json:"visibility,omitempty"`
	URL        string     `json:"url,omitempty"`
	IP         string     `json:"ip,omitempty"`
}

APIServerProfile represents an API server profile

type AsyncOperation

type AsyncOperation struct {
	MissingFields

	ID   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`

	InitialProvisioningState ProvisioningState `json:"initialStatus,omitempty"`
	ProvisioningState        ProvisioningState `json:"status,omitempty"`

	StartTime time.Time  `json:"startTime,omitempty"`
	EndTime   *time.Time `json:"endTime,omitempty"`

	Error *CloudErrorBody `json:"error,omitempty"`
}

AsyncOperation represents an asyncOperation

type AsyncOperationDocument

type AsyncOperationDocument struct {
	MissingFields

	ID          string `json:"id,omitempty"`
	ResourceID  string `json:"_rid,omitempty"`
	Timestamp   int    `json:"_ts,omitempty"`
	Self        string `json:"_self,omitempty"`
	ETag        string `json:"_etag,omitempty"`
	Attachments string `json:"_attachments,omitempty"`

	AsyncOperation *AsyncOperation `json:"asyncOperation,omitempty"`

	OpenShiftClusterKey string            `json:"openShiftClusterKey,omitempty"`
	OpenShiftCluster    *OpenShiftCluster `json:"openShiftCluster,omitempty"`
}

AsyncOperationDocument represents a asyncOperation document. pkg/database/cosmosdb requires its definition.

type AsyncOperationDocuments

type AsyncOperationDocuments struct {
	Count                   int                       `json:"_count,omitempty"`
	ResourceID              string                    `json:"_rid,omitempty"`
	AsyncOperationDocuments []*AsyncOperationDocument `json:"Documents,omitempty"`
}

AsyncOperationDocuments represents asyncOperation documents. pkg/database/cosmosdb requires its definition.

type CloudError

type CloudError struct {
	// The status code.
	StatusCode int `json:"-"`

	// An error response from the service.
	*CloudErrorBody `json:"error,omitempty"`
}

CloudError represents a cloud error.

func NewCloudError

func NewCloudError(statusCode int, code, target, message string, a ...interface{}) *CloudError

NewCloudError returns a new CloudError

func (*CloudError) Error

func (err *CloudError) Error() string

type CloudErrorBody

type CloudErrorBody struct {
	// An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
	Code string `json:"code,omitempty"`

	// A message describing the error, intended to be suitable for display in a user interface.
	Message string `json:"message,omitempty"`

	// The target of the particular error. For example, the name of the property in error.
	Target string `json:"target,omitempty"`

	//A list of additional details about the error.
	Details []CloudErrorBody `json:"details,omitempty"`
}

CloudErrorBody represents the body of a cloud error.

type ClusterProfile

type ClusterProfile struct {
	MissingFields

	Domain          string `json:"domain,omitempty"`
	Version         string `json:"version,omitempty"`
	ResourceGroupID string `json:"resourceGroupId,omitempty"`
}

ClusterProfile represents a cluster profile.

type Display

type Display struct {
	// Friendly name of the resource provider.
	Provider string `json:"provider,omitempty"`

	// Resource type on which the operation is performed.
	Resource string `json:"resource,omitempty"`

	// Operation type: read, write, delete, listKeys/action, etc.
	Operation string `json:"operation,omitempty"`

	// Friendly name of the operation.
	Description string `json:"description,omitempty"`
}

Display represents the display details of an operation.

type IngressProfile

type IngressProfile struct {
	MissingFields

	Name       string     `json:"name,omitempty"`
	Visibility Visibility `json:"visibility,omitempty"`
	IP         string     `json:"ip,omitempty"`
}

IngressProfile represents an ingress profile

type Install

type Install struct {
	MissingFields

	Now   time.Time    `json:"now,omitempty"`
	Phase InstallPhase `json:"phase"`
}

Install represents an install process

type InstallPhase

type InstallPhase int

InstallPhase represents an install phase

const (
	InstallPhaseDeployStorage InstallPhase = iota
	InstallPhaseDeployResources
	InstallPhaseRemoveBootstrap
)

InstallPhase constants

func InstallPhaseString

func InstallPhaseString(s string) (InstallPhase, error)

InstallPhaseString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func InstallPhaseValues

func InstallPhaseValues() []InstallPhase

InstallPhaseValues returns all values of the enum

func (InstallPhase) IsAInstallPhase

func (i InstallPhase) IsAInstallPhase() bool

IsAInstallPhase returns "true" if the value is listed in the enum definition. "false" otherwise

func (InstallPhase) MarshalJSON

func (p InstallPhase) MarshalJSON() ([]byte, error)

MarshalJSON marshals an InstallPhase

func (InstallPhase) String

func (i InstallPhase) String() string

func (*InstallPhase) UnmarshalJSON

func (p *InstallPhase) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals an InstallPhase

type MasterProfile

type MasterProfile struct {
	MissingFields

	VMSize   VMSize `json:"vmSize,omitempty"`
	SubnetID string `json:"subnetId,omitempty"`
}

MasterProfile represents a master profile

type MissingFields

type MissingFields struct {
	// contains filtered or unexported fields
}

MissingFields retains values that do not map to struct fields during JSON marshalling/unmarshalling. MissingFields implements github.com/ugorji/go/codec.MissingFielder.

func (*MissingFields) CodecMissingField

func (mf *MissingFields) CodecMissingField(field []byte, value interface{}) bool

CodecMissingField is called to set a missing field and value pair

func (*MissingFields) CodecMissingFields

func (mf *MissingFields) CodecMissingFields() map[string]interface{}

CodecMissingFields returns the set of fields which are not struct fields

type NetworkProfile

type NetworkProfile struct {
	MissingFields

	PodCIDR     string `json:"podCidr,omitempty"`
	ServiceCIDR string `json:"serviceCidr,omitempty"`

	PrivateEndpointIP string `json:"privateEndpointIp,omitempty"`
}

NetworkProfile represents a network profile

type OpenShiftCluster

type OpenShiftCluster struct {
	MissingFields

	// ID, Name and Type are cased as the user provided them at create time.
	// ID, Name, Type and Location are immutable.
	ID         string            `json:"id,omitempty"`
	Name       string            `json:"name,omitempty"`
	Type       string            `json:"type,omitempty"`
	Location   string            `json:"location,omitempty"`
	Tags       map[string]string `json:"tags,omitempty"`
	Properties Properties        `json:"properties,omitempty"`
}

OpenShiftCluster represents an OpenShift cluster

type OpenShiftClusterConverter

type OpenShiftClusterConverter interface {
	ToExternal(*OpenShiftCluster) interface{}
	ToExternalList([]*OpenShiftCluster) interface{}
	ToInternal(interface{}, *OpenShiftCluster)
}

type OpenShiftClusterCredentialsConverter

type OpenShiftClusterCredentialsConverter interface {
	ToExternal(*OpenShiftCluster) interface{}
}

type OpenShiftClusterDocument

type OpenShiftClusterDocument struct {
	MissingFields

	ID          string `json:"id,omitempty"`
	ResourceID  string `json:"_rid,omitempty"`
	Timestamp   int    `json:"_ts,omitempty"`
	Self        string `json:"_self,omitempty"`
	ETag        string `json:"_etag,omitempty"`
	Attachments string `json:"_attachments,omitempty"`

	Key                       string `json:"key,omitempty"`
	PartitionKey              string `json:"partitionKey,omitempty"`
	ClusterResourceGroupIDKey string `json:"clusterResourceGroupIdKey,omitempty"`

	LeaseOwner   string `json:"leaseOwner,omitempty"`
	LeaseExpires int    `json:"leaseExpires,omitempty"`
	Dequeues     int    `json:"dequeues,omitempty"`

	AsyncOperationID string `json:"asyncOperationId,omitempty"`

	OpenShiftCluster *OpenShiftCluster `json:"openShiftCluster,omitempty"`
}

OpenShiftClusterDocument represents an OpenShift cluster document. pkg/database/cosmosdb requires its definition.

type OpenShiftClusterDocuments

type OpenShiftClusterDocuments struct {
	Count                     int                         `json:"_count,omitempty"`
	ResourceID                string                      `json:"_rid,omitempty"`
	OpenShiftClusterDocuments []*OpenShiftClusterDocument `json:"Documents,omitempty"`
}

OpenShiftClusterDocuments represents OpenShift cluster documents. pkg/database/cosmosdb requires its definition.

type OpenShiftClusterValidator

type OpenShiftClusterValidator interface {
	Static(interface{}, *OpenShiftCluster) error
	Dynamic(context.Context, *OpenShiftCluster) error
}

type Operation

type Operation struct {
	// Operation name: {provider}/{resource}/{operation}.
	Name string `json:"name,omitempty"`

	// The object that describes the operation.
	Display Display `json:"display,omitempty"`
}

Operation represents an operation.

type OperationList

type OperationList struct {
	// List of operations supported by the resource provider.
	Operations []Operation `json:"value"`
}

OperationList represents an operation list.

func ExampleOperationListResponse

func ExampleOperationListResponse() *OperationList

ExampleOperationListResponse returns an example OperationList object that the RP might return to an end-user

type Properties

type Properties struct {
	MissingFields

	ProvisioningState       ProvisioningState `json:"provisioningState,omitempty"`
	FailedProvisioningState ProvisioningState `json:"failedProvisioningState,omitempty"`

	ClusterProfile ClusterProfile `json:"clusterProfile,omitempty"`

	ServicePrincipalProfile ServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"`

	NetworkProfile NetworkProfile `json:"networkProfile,omitempty"`

	MasterProfile MasterProfile `json:"masterProfile,omitempty"`

	WorkerProfiles []WorkerProfile `json:"workerProfiles,omitempty"`

	APIServerProfile APIServerProfile `json:"apiserverProfile,omitempty"`

	IngressProfiles []IngressProfile `json:"ingressProfiles,omitempty"`

	ConsoleURL string `json:"consoleUrl,omitempty"`

	// Install is non-nil only when an install is in progress
	Install *Install `json:"install,omitempty"`

	StorageSuffix string `json:"storageSuffix,omitempty"`

	SSHKey            *rsa.PrivateKey `json:"sshKey,omitempty"`
	AdminKubeconfig   []byte          `json:"adminKubeconfig,omitempty"`
	KubeadminPassword string          `json:"kubeadminPassword,omitempty"`
}

Properties represents an OpenShift cluster's properties

type ProvisioningState

type ProvisioningState string

ProvisioningState represents a provisioning state

const (
	ProvisioningStateCreating  ProvisioningState = "Creating"
	ProvisioningStateUpdating  ProvisioningState = "Updating"
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	ProvisioningStateFailed    ProvisioningState = "Failed"
)

ProvisioningState constants

type ServicePrincipalProfile

type ServicePrincipalProfile struct {
	MissingFields

	TenantID     string `json:"tenantId,omitempty"`
	ClientID     string `json:"clientId,omitempty"`
	ClientSecret string `json:"clientSecret,omitempty"`
}

ServicePrincipalProfile represents a service principal profile.

type Subscription

type Subscription struct {
	MissingFields

	State SubscriptionState `json:"state,omitempty"`

	Properties *SubscriptionProperties `json:"properties,omitempty"`
}

Subscription represents a subscription

type SubscriptionDocument

type SubscriptionDocument struct {
	MissingFields

	ID          string `json:"id,omitempty"`
	ResourceID  string `json:"_rid,omitempty"`
	Timestamp   int    `json:"_ts,omitempty"`
	Self        string `json:"_self,omitempty"`
	ETag        string `json:"_etag,omitempty"`
	Attachments string `json:"_attachments,omitempty"`

	LeaseOwner   string `json:"leaseOwner,omitempty"`
	LeaseExpires int    `json:"leaseExpires,omitempty"`
	Dequeues     int    `json:"dequeues,omitempty"`

	Deleting bool `json:"deleting,omitempty"`

	Subscription *Subscription `json:"subscription,omitempty"`
}

SubscriptionDocument represents a subscription document. pkg/database/cosmosdb requires its definition.

type SubscriptionDocuments

type SubscriptionDocuments struct {
	Count                 int                     `json:"_count,omitempty"`
	ResourceID            string                  `json:"_rid,omitempty"`
	SubscriptionDocuments []*SubscriptionDocument `json:"Documents,omitempty"`
}

SubscriptionDocuments represents subscription documents. pkg/database/cosmosdb requires its definition.

type SubscriptionProperties

type SubscriptionProperties struct {
	MissingFields

	TenantID string `json:"tenantId,omitempty"`
}

SubscriptionProperties represents subscription properties

type SubscriptionState

type SubscriptionState string

SubscriptionState represents a subscription state

const (
	SubscriptionStateRegistered   SubscriptionState = "Registered"
	SubscriptionStateUnregistered SubscriptionState = "Unregistered"
	SubscriptionStateWarned       SubscriptionState = "Warned"
	SubscriptionStateSuspended    SubscriptionState = "Suspended"
	SubscriptionStateDeleted      SubscriptionState = "Deleted"
)

SubscriptionState constants

type VMSize

type VMSize string

VMSize represents a VM size

const (
	VMSizeStandardD2sV3 VMSize = "Standard_D2s_v3"
	VMSizeStandardD4sV3 VMSize = "Standard_D4s_v3"
	VMSizeStandardD8sV3 VMSize = "Standard_D8s_v3"
)

VMSize constants

type Version

type Version struct {
	OpenShiftClusterConverter            func() OpenShiftClusterConverter
	OpenShiftClusterValidator            func(env.Interface, string) OpenShiftClusterValidator
	OpenShiftClusterCredentialsConverter func() OpenShiftClusterCredentialsConverter
}

Version is a set of endpoints implemented by each API version

type Visibility

type Visibility string

Visibility represents visibility.

const (
	VisibilityPublic  Visibility = "Public"
	VisibilityPrivate Visibility = "Private"
)

Visibility constants

type WorkerProfile

type WorkerProfile struct {
	MissingFields

	Name       string `json:"name,omitempty"`
	VMSize     VMSize `json:"vmSize,omitempty"`
	DiskSizeGB int    `json:"diskSizeGB,omitempty"`
	SubnetID   string `json:"subnetId,omitempty"`
	Count      int    `json:"count,omitempty"`
}

WorkerProfile represents a worker profile

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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