api

package
v0.0.0-...-54afde0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CloudErrorCodeInternalServerError                = "InternalServerError"
	CloudErrorCodeInvalidParameter                   = "InvalidParameter"
	CloudErrorCodeInvalidRequestContent              = "InvalidRequestContent"
	CloudErrorCodeInvalidResource                    = "InvalidResource"
	CloudErrorCodeDuplicateResourceGroup             = "DuplicateResourceGroup"
	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"
	CloudErrorCodeDuplicateClientID                  = "DuplicateClientID"
	CloudErrorCodeDuplicateDomain                    = "DuplicateDomain"
	CloudErrorCodeResourceQuotaExceeded              = "ResourceQuotaExceeded"
	CloudErrorCodeQuotaExceeded                      = "QuotaExceeded"
	CloudErrorResourceProviderNotRegistered          = "ResourceProviderNotRegistered"
)

CloudErrorCodes

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

APIs is the map of registered API versions

Functions

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"`
	LSN         int                    `json:"_lsn,omitempty"`
	Metadata    map[string]interface{} `json:"_metadata,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 Billing

type Billing struct {
	MissingFields

	CreationTime    int `json:"creationTime,omitempty"`
	DeletionTime    int `json:"deletionTime,omitempty"`
	LastBillingTime int `json:"lastBillingTime,omitempty"`

	Location string `json:"location,omitempty"`
	TenantID string `json:"tenantID,omitempty"`
}

Billing represents a Billing entry

type BillingDocument

type BillingDocument 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"`
	LSN         int                    `json:"_lsn,omitempty"`
	Metadata    map[string]interface{} `json:"_metadata,omitempty"`

	Billing *Billing `json:"billing,omitempty"`

	Key                       string `json:"key,omitempty"`
	ClusterResourceGroupIDKey string `json:"clusterResourceGroupIDKey,omitempty"`
}

BillingDocument represents a billing document. pkg/database/cosmosdb requires its definition.

type BillingDocuments

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

BillingDocuments represents billing 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

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

ClusterProfile represents a cluster profile.

type ConsoleProfile

type ConsoleProfile struct {
	MissingFields

	URL string `json:"url,omitempty"`
}

ConsoleProfile represents a console profile.

type CorrelationData

type CorrelationData struct {
	// CorrelationID contains value of x-ms-correlation-request-id
	CorrelationID string `json:"correlationId,omitempty"`

	// ClientRequestID contains value of x-ms-client-request-id
	ClientRequestID string `json:"clientRequestId,omitempty"`

	// RequestID contains value of x-ms-request-id
	RequestID string `json:"requestID,omitempty"`
}

CorrelationData represents any data, used for metrics or tracing. More on these values: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-details.md

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 (
	InstallPhaseBootstrap InstallPhase = iota
	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 Monitor

type Monitor struct {
	MissingFields

	Buckets []string `json:"buckets,omitempty"`
}

Monitor represents a monitor

type MonitorDocument

type MonitorDocument 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"`
	TTL         int                    `json:"ttl,omitempty"`
	LSN         int                    `json:"_lsn,omitempty"`
	Metadata    map[string]interface{} `json:"_metadata,omitempty"`

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

	Monitor *Monitor `json:"monitor,omitempty"`
}

MonitorDocument represents a monitor document. pkg/database/cosmosdb requires its definition.

type MonitorDocuments

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

MonitorDocuments represents monitor documents. pkg/database/cosmosdb requires its definition.

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 OpenShiftClusterProperties `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"`
	LSN         int                    `json:"_lsn,omitempty"`
	Metadata    map[string]interface{} `json:"_metadata,omitempty"`

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

	Bucket int `json:"bucket,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"`

	CorrelationData *CorrelationData `json:"correlationData,omitempty"`
}

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

func ExampleOpenShiftClusterDocument

func ExampleOpenShiftClusterDocument() *OpenShiftClusterDocument

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 OpenShiftClusterProperties

type OpenShiftClusterProperties struct {
	MissingFields

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

	ClusterProfile ClusterProfile `json:"clusterProfile,omitempty"`

	ConsoleProfile ConsoleProfile `json:"consoleProfile,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"`

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

	StorageSuffix string `json:"storageSuffix,omitempty"`

	SSHKey               SecureBytes  `json:"sshKey,omitempty"`
	AdminKubeconfig      SecureBytes  `json:"adminKubeconfig,omitempty"`
	AROServiceKubeconfig SecureBytes  `json:"aroServiceKubeconfig,omitempty"`
	KubeadminPassword    SecureString `json:"kubeadminPassword,omitempty"`

	RegistryProfiles []*RegistryProfile `json:"registryProfiles,omitempty"`
}

OpenShiftClusterProperties represents an OpenShift cluster's properties

type OpenShiftClusterStaticValidator

type OpenShiftClusterStaticValidator interface {
	Static(interface{}, *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"`

	// Sources of requests to this operation.  Comma separated list with valid values user or system, e.g. "user,system".
	Origin string `json:"origin,omitempty"`
}

Operation represents an RP operation.

type OperationList

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

	// The link used to get the next page of operations.
	NextLink string `json:"nextLink,omitempty"`
}

OperationList represents an RP operation list.

func ExampleOperationListResponse

func ExampleOperationListResponse() *OperationList

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

type ProvisioningState

type ProvisioningState string

ProvisioningState represents a provisioning state

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

ProvisioningState constants

func (ProvisioningState) IsTerminal

func (t ProvisioningState) IsTerminal() bool

IsTerminal returns true if state is Terminal

type RegistryProfile

type RegistryProfile struct {
	MissingFields

	Name     string       `json:"name,omitempty"`
	Username string       `json:"username,omitempty"`
	Password SecureString `json:"password,omitempty"`
}

RegistryProfile represents a registry's login

type SecureBytes

type SecureBytes []byte

SecureBytes represents an encrypted []byte

type SecureString

type SecureString string

SecureString represents an encrypted string

type ServicePrincipalProfile

type ServicePrincipalProfile struct {
	MissingFields

	TenantID     string       `json:"tenantId,omitempty"`
	ClientID     string       `json:"clientId,omitempty"`
	ClientSecret SecureString `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"`
	LSN         int                    `json:"_lsn,omitempty"`
	Metadata    map[string]interface{} `json:"_metadata,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 add required resources in pkg/api/validate/quota.go when adding a new VMSize

type Version

type Version struct {
	OpenShiftClusterConverter            func() OpenShiftClusterConverter
	OpenShiftClusterStaticValidator      func(string, string, string) OpenShiftClusterStaticValidator
	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