Documentation ¶
Index ¶
- Variables
- func AddExtensions(h *codec.BasicHandle) error
- func WriteCloudError(w http.ResponseWriter, err *CloudError)
- func WriteError(w http.ResponseWriter, statusCode int, code, target, message string, ...)
- type CloudError
- type CloudErrorBody
- type Display
- type Install
- type InstallPhase
- type Key
- type MasterProfile
- type MissingFields
- type NetworkProfile
- type OpenShiftCluster
- type OpenShiftClusterDocument
- type OpenShiftClusterDocuments
- type OpenShiftClusterToExternal
- type OpenShiftClusterToInternal
- type OpenShiftClustersToExternal
- type Operation
- type OperationList
- type Properties
- type ProvisioningState
- type ServicePrincipalProfile
- type Subscription
- type SubscriptionDocument
- type SubscriptionDocuments
- type SubscriptionProperties
- type SubscriptionState
- type VMSize
- type WorkerProfile
Constants ¶
This section is empty.
Variables ¶
var ( CloudErrorCodeInternalServerError = "InternalServerError" CloudErrorCodeInvalidParameter = "InvalidParameter" CloudErrorCodeInvalidRequestContent = "InvalidRequestContent" CloudErrorCodeInvalidResource = "InvalidResource" CloudErrorCodeInvalidResourceNamespace = "InvalidResourceNamespace" CloudErrorCodeInvalidResourceType = "InvalidResourceType" CloudErrorCodeInvalidSubscriptionID = "CloudErrorCodeInvalidSubscriptionID" CloudErrorCodeMismatchingResourceID = "MismatchingResourceID" CloudErrorCodeMismatchingResourceName = "MismatchingResourceName" CloudErrorCodeMismatchingResourceType = "MismatchingResourceType" CloudErrorCodePropertyChangeNotAllowed = "PropertyChangeNotAllowed" CloudErrorCodeRequestNotAllowed = "RequestNotAllowed" CloudErrorCodeResourceGroupNotFound = "ResourceGroupNotFound" CloudErrorCodeResourceNotFound = "ResourceNotFound" CloudErrorCodeUnsupportedMediaType = "UnsupportedMediaType" CloudErrorCodeInvalidLinkedVNet = "InvalidLinkedVNet" CloudErrorCodeNotFound = "NotFound" CloudErrorCodeForbidden = "Forbidden" CloudErrorCodeInvalidSubscriptionState = "CloudErrorCodeInvalidSubscriptionState" CloudErrorCodeInvalidServicePrincipalCredentials = "InvalidServicePrincipalCredentials" CloudErrorCodeInvalidResourceProviderPermissions = "InvalidResourceProviderPermissions" CloudErrorCodeInvalidServicePrincipalPermissions = "InvalidServicePrincipalPermissions" )
CloudErrorCodes
var APIs = map[string]map[string]interface{}{}
APIs is the map of registered external APIs
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 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 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 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"` }
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 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 Key `json:"key,omitempty"` PartitionKey string `json:"partitionKey,omitempty"` LeaseOwner *uuid.UUID `json:"leaseOwner,omitempty"` LeaseExpires int `json:"leaseExpires,omitempty"` Dequeues int `json:"dequeues,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 OpenShiftClusterToExternal ¶
type OpenShiftClusterToExternal interface {
OpenShiftClusterToExternal(*OpenShiftCluster) interface{}
}
OpenShiftClusterToExternal is implemented by all APIs - it enables conversion of the internal OpenShiftCluster representation to the API-specific versioned external representation
type OpenShiftClusterToInternal ¶
type OpenShiftClusterToInternal interface { OpenShiftClusterToInternal(interface{}, *OpenShiftCluster) ValidateOpenShiftCluster(string, string, interface{}, *OpenShiftCluster) error ValidateOpenShiftClusterDynamic(context.Context, func(string, string) (autorest.Authorizer, error), *OpenShiftCluster) error }
OpenShiftClusterToInternal is implemented by APIs that can convert their API-specific versioned external representation to the internal OpenShiftCluster representation. It also includes validators
type OpenShiftClustersToExternal ¶
type OpenShiftClustersToExternal interface {
OpenShiftClustersToExternal([]*OpenShiftCluster) interface{}
}
OpenShiftClustersToExternal is implemented by APIs that can convert multiple internal OpenShiftCluster representations to the API-specific versioned external representation
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.
type Properties ¶
type Properties struct { MissingFields ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` FailedProvisioningState ProvisioningState `json:"failedProvisioningState,omitempty"` ServicePrincipalProfile ServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` NetworkProfile NetworkProfile `json:"networkProfile,omitempty"` MasterProfile MasterProfile `json:"masterProfile,omitempty"` WorkerProfiles []WorkerProfile `json:"workerProfiles,omitempty"` APIServerURL string `json:"apiserverUrl,omitempty"` ConsoleURL string `json:"consoleUrl,omitempty"` // Install is non-nil only when an install is in progress Install *Install `json:"install,omitempty"` // TODO: ResourceGroup should be exposed in external API ResourceGroup string `json:"resourceGroup,omitempty"` DomainName string `json:"domainName,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"` Key Key `json:"key,omitempty"` // also the partition key LeaseOwner *uuid.UUID `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 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