Documentation
¶
Index ¶
- Constants
- func CheckOngoingOperation(ctx context.Context, client *APIClient, mtaId string, namespace string, ...) (bool, error)
- func PollMtaOperation(ctx context.Context, client *APIClient, spaceGuid string, operationId string, ...) (string, error)
- type APIClient
- type Configuration
- type DefaultApiGetMtaOperationsOpts
- type DefaultApiService
- func (a *DefaultApiService) AsyncUploadFileFromURL(ctx context.Context, spaceGuid string, namespace string, fileURL string) (string, *http.Response, error)
- func (a *DefaultApiService) ExecuteOperationAction(ctx context.Context, spaceGuid string, operationId string, actionId string) (string, *http.Response, error)
- func (a *DefaultApiService) GetAsyncUploadJob(ctx context.Context, spaceGuid string, jobId string, xInstance string, ...) (UploadStatus, *http.Response, error)
- func (a *DefaultApiService) GetCsrfToken(ctx context.Context) (*http.Response, error)
- func (a *DefaultApiService) GetMta(ctx context.Context, spaceGuid string, mtaId string, namespace string) (Mta, *http.Response, error)
- func (a *DefaultApiService) GetMtaOperation(ctx context.Context, spaceGuid string, operationId string, ...) (Operation, *http.Response, error)
- func (a *DefaultApiService) GetMtaOperations(ctx context.Context, spaceGuid string, ...) ([]Operation, *http.Response, error)
- func (a *DefaultApiService) GetMtas(ctx context.Context, spaceGuid string, namespace *string, mtaId string) ([]Mta, *http.Response, error)
- func (a *DefaultApiService) StartMtaOperation(ctx context.Context, spaceGuid string, operationRequest Operation) (string, Operation, *http.Response, error)
- func (a *DefaultApiService) UploadMtaFile(ctx context.Context, spaceGuid string, namespace string, filePath string) (FileMetadata, *http.Response, error)
- type FileMetadata
- type FileUrl
- type GenericError
- type Log
- type Message
- type Metadata
- type Module
- type Mta
- type MtaDescriptor
- type Operation
- type ProcessType
- type Request
- type UploadStatus
Constants ¶
const ( POST string = "POST" GET string = "GET" MTA_NOT_FOUND string = "no mta found with given id" )
const ( FinishedState string = "FINISHED" AbortedState string = "ABORTED" )
Variables ¶
This section is empty.
Functions ¶
func CheckOngoingOperation ¶
func CheckOngoingOperation(ctx context.Context, client *APIClient, mtaId string, namespace string, spaceGuid string) (bool, error)
ref - https://github.com/cloudfoundry/multiapps-cli-plugin/blob/v3.2.2/commands/deploy_command.go CheckOngoingOperation checks for ongoing operation for mta with the specified id and tries to abort it.
Types ¶
type APIClient ¶
type APIClient struct {
// API Services
DefaultApi *DefaultApiService
// contains filtered or unexported fields
}
APIClient manages communication with the MTA REST API API v1.3.0 In most cases there should be only one, shared, APIClient.
func NewAPIClient ¶
func NewAPIClient(cfg *Configuration) *APIClient
NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.
func (*APIClient) ChangeBasePath ¶
Change base path to allow switching to mocks.
type Configuration ¶
type Configuration struct {
BasePath string `json:"basePath,omitempty"`
Host string `json:"host,omitempty"`
Scheme string `json:"scheme,omitempty"`
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
HTTPClient *http.Client
}
func NewConfiguration ¶
func NewConfiguration(basePath string, userAgent string, client *http.Client) *Configuration
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
type DefaultApiService ¶
type DefaultApiService service
func (*DefaultApiService) AsyncUploadFileFromURL ¶
func (a *DefaultApiService) AsyncUploadFileFromURL(ctx context.Context, spaceGuid string, namespace string, fileURL string) (string, *http.Response, error)
Uploads an Multi Target Application archive from a remote URL.
func (*DefaultApiService) ExecuteOperationAction ¶
func (a *DefaultApiService) ExecuteOperationAction(ctx context.Context, spaceGuid string, operationId string, actionId string) (string, *http.Response, error)
Executes a particular action over Multi-Target Application operation.
func (*DefaultApiService) GetAsyncUploadJob ¶
func (a *DefaultApiService) GetAsyncUploadJob(ctx context.Context, spaceGuid string, jobId string, xInstance string, namespace string) (UploadStatus, *http.Response, error)
Gets the status of the upload job from the remote URL.
func (*DefaultApiService) GetCsrfToken ¶
Retrieves a csrf-token header.
func (*DefaultApiService) GetMta ¶
func (a *DefaultApiService) GetMta(ctx context.Context, spaceGuid string, mtaId string, namespace string) (Mta, *http.Response, error)
Retrieves Multi-Target Application in a space.
func (*DefaultApiService) GetMtaOperation ¶
func (a *DefaultApiService) GetMtaOperation(ctx context.Context, spaceGuid string, operationId string, embedProperty string) (Operation, *http.Response, error)
Retrieves Multi-Target Application operation.
func (*DefaultApiService) GetMtaOperations ¶
func (a *DefaultApiService) GetMtaOperations(ctx context.Context, spaceGuid string, localVarOptionals *DefaultApiGetMtaOperationsOpts) ([]Operation, *http.Response, error)
Retrieves Multi-Target Application operations.
func (*DefaultApiService) GetMtas ¶
func (a *DefaultApiService) GetMtas(ctx context.Context, spaceGuid string, namespace *string, mtaId string) ([]Mta, *http.Response, error)
Retrieves all Multi-Target Applications in a space.
func (*DefaultApiService) StartMtaOperation ¶
func (a *DefaultApiService) StartMtaOperation(ctx context.Context, spaceGuid string, operationRequest Operation) (string, Operation, *http.Response, error)
Starts execution of a Multi-Target Application operation.
func (*DefaultApiService) UploadMtaFile ¶
func (a *DefaultApiService) UploadMtaFile(ctx context.Context, spaceGuid string, namespace string, filePath string) (FileMetadata, *http.Response, error)
Uploads an Multi Target Application archive or an Extension Descriptor.
type FileMetadata ¶
type FileMetadata struct {
Id string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Size int32 `json:"size,omitempty"`
Digest string `json:"digest,omitempty"`
DigestAlgorithm string `json:"digestAlgorithm,omitempty"`
Space string `json:"space,omitempty"`
Namespace string `json:"namespace,omitempty"`
}
type GenericError ¶
type GenericError struct {
// contains filtered or unexported fields
}
GenericError Provides access to the body, error and model on returned errors.
func (GenericError) Body ¶
func (e GenericError) Body() []byte
Body returns the raw bytes of the response.
func (GenericError) Error ¶
func (e GenericError) Error() string
Error returns non-empty string if there was an error.
func (GenericError) Model ¶
func (e GenericError) Model() interface{}
Model returns the unpacked model of the error.
type Log ¶
type Log struct {
Id string `json:"id,omitempty"`
LastModified time.Time `json:"lastModified,omitempty"`
Content string `json:"content,omitempty"`
Size int64 `json:"size,omitempty"`
DisplayName string `json:"displayName,omitempty"`
Description string `json:"description,omitempty"`
ExternalInfo string `json:"externalInfo,omitempty"`
}
type Module ¶
type Module struct {
ModuleName string `json:"moduleName,omitempty"`
AppName string `json:"appName,omitempty"`
CreatedOn time.Time `json:"createdOn,omitempty"`
UpdatedOn time.Time `json:"updatedOn,omitempty"`
ProvidedDendencyNames []string `json:"providedDendencyNames,omitempty"`
Services []string `json:"services,omitempty"`
Uris []string `json:"uris,omitempty"`
}
type MtaDescriptor ¶
type MtaDescriptor struct {
SchemaVersion string `yaml:"_schema-version,omitempty"`
ID string `yaml:"ID,omitempty"`
Version string `yaml:"version,omitempty"`
Namespace string `yaml:"namespace,omitempty"`
}
func GetMtaDescriptorFromArchive ¶
func GetMtaDescriptorFromArchive(mtaArchiveFilePath string) (MtaDescriptor, error)
ref - https://github.com/cloudfoundry/multiapps-cli-plugin/blob/v3.2.2/util/archive_handler.go GetMtaDescriptorFromArchive retrieves MTA ID from MTA archive.
type Operation ¶
type Operation struct {
ProcessId string `json:"processId,omitempty"`
ProcessType string `json:"processType,omitempty"`
StartedAt string `json:"startedAt,omitempty"`
EndedAt string `json:"endedAt,omitempty"`
SpaceId string `json:"spaceId,omitempty"`
MtaId string `json:"mtaId,omitempty"`
Namespace string `json:"namespace,omitempty"`
User string `json:"user,omitempty"`
AcquiredLock bool `json:"acquiredLock,omitempty"`
State string `json:"state,omitempty"`
ErrorType string `json:"errorType,omitempty"`
Messages []Message `json:"messages,omitempty"`
Parameters map[string]interface{} `json:"parameters,omitempty"`
}
type ProcessType ¶
type ProcessType struct {
Name string `json:"name,omitempty"`
}
type UploadStatus ¶
type UploadStatus struct {
Status string `json:"status,omitempty"`
File FileMetadata `json:"file,omitempty"`
MtaId string `json:"mta_id,omitempty"`
Error string `json:"error,omitempty"`
}