Documentation
¶
Index ¶
- Variables
- type Api
- type ApplicationInfo
- type FileUpload
- type Parameter
- type ParametersUiStruct
- type ParametersValidationStruct
- type Recurrence
- type Schedule
- type ScheduleLocator
- func (loc *ScheduleLocator) Create(name string, startRecurrence *Recurrence, stopRecurrence *Recurrence, ...) (*ScheduleLocator, error)
- func (loc *ScheduleLocator) Delete() error
- func (loc *ScheduleLocator) Index() ([]*Schedule, error)
- func (loc *ScheduleLocator) MultiDelete(ids []string) error
- func (loc *ScheduleLocator) Show() (*Schedule, error)
- func (loc *ScheduleLocator) Update(options rsapi.ApiParams) error
- type Template
- type TemplateLocator
- func (loc *TemplateLocator) Compile(source string) error
- func (loc *TemplateLocator) Create(source *FileUpload) (*TemplateLocator, error)
- func (loc *TemplateLocator) Delete() error
- func (loc *TemplateLocator) Download(apiVersion string) error
- func (loc *TemplateLocator) Index(options rsapi.ApiParams) ([]*Template, error)
- func (loc *TemplateLocator) MultiDelete(ids []string) error
- func (loc *TemplateLocator) Publish(id string, options rsapi.ApiParams) error
- func (loc *TemplateLocator) Show(options rsapi.ApiParams) (*Template, error)
- func (loc *TemplateLocator) Unpublish(id string) error
- func (loc *TemplateLocator) Update(source *FileUpload) error
- type TimestampsStruct
- type TimestampsStruct2
- type UrlResolver
- type User
Constants ¶
This section is empty.
Variables ¶
var GenMetadata = map[string]*metadata.Resource{ "Schedule": &metadata.Resource{ Name: "Schedule", Description: `A Schedule represents a recurring period during which a CloudApp should be running. It must have a unique name and an optional description. The recurrence rules follow the [Recurrence Rule format](https://tools.ietf.org/html/rfc5545#section-3.8.5.3). Multiple Schedules can be associated with a Template when published to the Catalog. Users will be able to launch the resulting CloudApp with one of the associated schedule. Updating or deleting a Schedule will not affect CloudApps that were published with that Schedule.`, Actions: []*metadata.Action{ &metadata.Action{ Name: "index", Description: `List the schedules available in Designer.`, PathPatterns: []*metadata.PathPattern{ &metadata.PathPattern{ HttpMethod: "GET", Pattern: "/collections/%s/schedules", Variables: []string{"collection_id"}, Regexp: regexp.MustCompile(`/collections/([^/]+)/schedules`), }, }, CommandFlags: []*metadata.ActionParam{}, ApiParams: []*metadata.ActionParam{}, }, &metadata.Action{ Name: "show", Description: `Show detailed information about a given Schedule.`, PathPatterns: []*metadata.PathPattern{ &metadata.PathPattern{ HttpMethod: "GET", Pattern: "/collections/%s/schedules/%s", Variables: []string{"collection_id", "id"}, Regexp: regexp.MustCompile(`/collections/([^/]+)/schedules/([^/]+)`), }, }, CommandFlags: []*metadata.ActionParam{}, ApiParams: []*metadata.ActionParam{}, }, &metadata.Action{ Name: "create", Description: `Create a new Schedule.`, PathPatterns: []*metadata.PathPattern{ &metadata.PathPattern{ HttpMethod: "POST", Pattern: "/collections/%s/schedules", Variables: []string{"collection_id"}, Regexp: regexp.MustCompile(`/collections/([^/]+)/schedules`), }, }, CommandFlags: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "description", Description: `An optional description that will help users understand the purpose of the Schedule`, Type: "string", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, &metadata.ActionParam{ Name: "name", Description: `The unique name of the Schedule`, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "start_recurrence[hour]", Description: `The hour of day from 0 to 23.`, Type: "int", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "start_recurrence[minute]", Description: `The minute from 0 to 59.`, Type: "int", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "start_recurrence[rule]", Description: `A RRULE string describing the recurrence rule.`, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "start_recurrence[hour]", Description: `The hour of day from 0 to 23.`, Type: "int", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "start_recurrence[minute]", Description: `The minute from 0 to 59.`, Type: "int", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "start_recurrence[rule]", Description: `A RRULE string describing the recurrence rule.`, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, }, ApiParams: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "description", Description: `An optional description that will help users understand the purpose of the Schedule`, Type: "string", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, &metadata.ActionParam{ Name: "name", Description: `The unique name of the Schedule`, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "start_recurrence", Description: `When to start a CloudApp`, Type: "*Recurrence", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "stop_recurrence", Description: `When to stop a CloudApp`, Type: "*Recurrence", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, }, }, &metadata.Action{ Name: "update", Description: `Update one or more attributes of an existing Schedule. Note: updating a Schedule in Designer doesn't update it in the applications that were published with it to the Catalog or affect running CloudApps with that Schedule.`, PathPatterns: []*metadata.PathPattern{ &metadata.PathPattern{ HttpMethod: "PATCH", Pattern: "/collections/%s/schedules/%s", Variables: []string{"collection_id", "id"}, Regexp: regexp.MustCompile(`/collections/([^/]+)/schedules/([^/]+)`), }, }, CommandFlags: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "description", Description: `An optional description that will help users understand the purpose of the Schedule`, Type: "string", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, &metadata.ActionParam{ Name: "name", Description: `The unique name of the Schedule`, Type: "string", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, &metadata.ActionParam{ Name: "start_recurrence[hour]", Description: `The hour of day from 0 to 23.`, Type: "int", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "start_recurrence[minute]", Description: `The minute from 0 to 59.`, Type: "int", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "start_recurrence[rule]", Description: `A RRULE string describing the recurrence rule.`, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "start_recurrence[hour]", Description: `The hour of day from 0 to 23.`, Type: "int", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "start_recurrence[minute]", Description: `The minute from 0 to 59.`, Type: "int", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "start_recurrence[rule]", Description: `A RRULE string describing the recurrence rule.`, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, }, ApiParams: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "description", Description: `An optional description that will help users understand the purpose of the Schedule`, Type: "string", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, &metadata.ActionParam{ Name: "name", Description: `The unique name of the Schedule`, Type: "string", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, &metadata.ActionParam{ Name: "start_recurrence", Description: `When to start a CloudApp`, Type: "*Recurrence", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, &metadata.ActionParam{ Name: "stop_recurrence", Description: `When to stop a CloudApp`, Type: "*Recurrence", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, }, }, &metadata.Action{ Name: "delete", Description: `Delete a Schedule from the system. Note: deleting a Schedule from Designer doesn't remove it from the applications that were published with it to the Catalog or affect running CloudApps with that Schedule.`, PathPatterns: []*metadata.PathPattern{ &metadata.PathPattern{ HttpMethod: "DELETE", Pattern: "/collections/%s/schedules/%s", Variables: []string{"collection_id", "id"}, Regexp: regexp.MustCompile(`/collections/([^/]+)/schedules/([^/]+)`), }, }, CommandFlags: []*metadata.ActionParam{}, ApiParams: []*metadata.ActionParam{}, }, &metadata.Action{ Name: "multi_delete", Description: `Delete multiple Schedules from the system in bulk. Note: deleting a Schedule from Designer doesn't remove it from the applications that were published with it to the Catalog or affect running CloudApps with that Schedule.`, PathPatterns: []*metadata.PathPattern{ &metadata.PathPattern{ HttpMethod: "DELETE", Pattern: "/collections/%s/schedules", Variables: []string{"collection_id"}, Regexp: regexp.MustCompile(`/collections/([^/]+)/schedules`), }, }, CommandFlags: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "ids[]", Description: `The IDs of the Schedules to delete`, Type: "[]string", Location: metadata.QueryParam, Mandatory: true, NonBlank: false, }, }, ApiParams: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "ids[]", Description: `The IDs of the Schedules to delete`, Type: "[]string", Location: metadata.QueryParam, Mandatory: true, NonBlank: false, }, }, }, }, }, "Template": &metadata.Resource{ Name: "Template", Description: `A Template represent a CloudApplication Template (CAT) that has been uploaded to this design collection. For information on the syntax of a CAT file, please see the [CAT Designers Guide](http://support.rightscale.com/12-Guides/Self-Service/20_Cloud_Application_Template_%28CAT%29_Designers_Guide) on the RightScale Support site. A CAT file is compiled by Self-Service to make it ready for publication and subsequent launch by users. To test your CAT file syntax, you can call the compile action with the source content. In order to Publish your CAT to the Catalog where users can launch it, it must be uploaded to Designer first, and then published to the Catalog. CAT files are uniquely identified by the name of the CloudApplication, which is specified as the "name" attribute inside of a CAT file.`, Actions: []*metadata.Action{ &metadata.Action{ Name: "index", Description: `List the templates available in Designer along with some general details.`, PathPatterns: []*metadata.PathPattern{ &metadata.PathPattern{ HttpMethod: "GET", Pattern: "/collections/%s/templates", Variables: []string{"collection_id"}, Regexp: regexp.MustCompile(`/collections/([^/]+)/templates`), }, }, CommandFlags: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "ids[]", Description: `An optional list of template IDs to retrieve`, Type: "[]string", Location: metadata.QueryParam, Mandatory: false, NonBlank: false, }, }, ApiParams: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "ids[]", Description: `An optional list of template IDs to retrieve`, Type: "[]string", Location: metadata.QueryParam, Mandatory: false, NonBlank: false, }, }, }, &metadata.Action{ Name: "show", Description: `Show detailed information about a given Template. Use the views specified below for more information.`, PathPatterns: []*metadata.PathPattern{ &metadata.PathPattern{ HttpMethod: "GET", Pattern: "/collections/%s/templates/%s", Variables: []string{"collection_id", "id"}, Regexp: regexp.MustCompile(`/collections/([^/]+)/templates/([^/]+)`), }, }, CommandFlags: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "view", Description: `Optional view to return`, Type: "string", Location: metadata.QueryParam, Mandatory: false, NonBlank: false, ValidValues: []string{"default", "expanded"}, }, }, ApiParams: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "view", Description: `Optional view to return`, Type: "string", Location: metadata.QueryParam, Mandatory: false, NonBlank: false, ValidValues: []string{"default", "expanded"}, }, }, }, &metadata.Action{ Name: "create", Description: `Create a new Template by uploading its content to Designer.`, PathPatterns: []*metadata.PathPattern{ &metadata.PathPattern{ HttpMethod: "POST", Pattern: "/collections/%s/templates", Variables: []string{"collection_id"}, Regexp: regexp.MustCompile(`/collections/([^/]+)/templates`), }, }, CommandFlags: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "source[filename]", Description: `The name of the file being uploaded`, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "source[head]", Description: ``, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "source[name]", Description: ``, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "source[tempfile]", Description: ``, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "source[type]", Description: ``, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, }, ApiParams: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "source", Description: `Multipart File Upload`, Type: "*FileUpload", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, }, }, &metadata.Action{ Name: "update", Description: `Update the content of an existing Template (a Template with the same "name" value in the CAT).`, PathPatterns: []*metadata.PathPattern{ &metadata.PathPattern{ HttpMethod: "PUT", Pattern: "/collections/%s/templates/%s", Variables: []string{"collection_id", "id"}, Regexp: regexp.MustCompile(`/collections/([^/]+)/templates/([^/]+)`), }, }, CommandFlags: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "source[filename]", Description: `The name of the file being uploaded`, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "source[head]", Description: ``, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "source[name]", Description: ``, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "source[tempfile]", Description: ``, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "source[type]", Description: ``, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, }, ApiParams: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "source", Description: `Multipart File Upload`, Type: "*FileUpload", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, }, }, &metadata.Action{ Name: "delete", Description: `Delete a Template from the system. Note: deleting a Template from Designer doesn't remove it from the Catalog if it has already been published -- see the "unpublish" action.`, PathPatterns: []*metadata.PathPattern{ &metadata.PathPattern{ HttpMethod: "DELETE", Pattern: "/collections/%s/templates/%s", Variables: []string{"collection_id", "id"}, Regexp: regexp.MustCompile(`/collections/([^/]+)/templates/([^/]+)`), }, }, CommandFlags: []*metadata.ActionParam{}, ApiParams: []*metadata.ActionParam{}, }, &metadata.Action{ Name: "multi_delete", Description: `Delete multiple Templates from the system in bulk. Note: deleting a Template from Designer doesn't remove it from the Catalog if it has already been published -- see the "unpublish" action.`, PathPatterns: []*metadata.PathPattern{ &metadata.PathPattern{ HttpMethod: "DELETE", Pattern: "/collections/%s/templates", Variables: []string{"collection_id"}, Regexp: regexp.MustCompile(`/collections/([^/]+)/templates`), }, }, CommandFlags: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "ids[]", Description: `The IDs of the Template to delete`, Type: "[]string", Location: metadata.QueryParam, Mandatory: true, NonBlank: false, }, }, ApiParams: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "ids[]", Description: `The IDs of the Template to delete`, Type: "[]string", Location: metadata.QueryParam, Mandatory: true, NonBlank: false, }, }, }, &metadata.Action{ Name: "download", Description: `Download the source of a Template.`, PathPatterns: []*metadata.PathPattern{ &metadata.PathPattern{ HttpMethod: "GET", Pattern: "/collections/%s/templates/%s/download", Variables: []string{"collection_id", "id"}, Regexp: regexp.MustCompile(`/collections/([^/]+)/templates/([^/]+)/download`), }, }, CommandFlags: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "api_version", Description: `The API version (only valid value is currently "1.0")`, Type: "string", Location: metadata.QueryParam, Mandatory: true, NonBlank: false, }, }, ApiParams: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "api_version", Description: `The API version (only valid value is currently "1.0")`, Type: "string", Location: metadata.QueryParam, Mandatory: true, NonBlank: false, }, }, }, &metadata.Action{ Name: "compile", Description: `Compile the Template, but don't save it to Designer. Useful for debugging a CAT file while you are still authoring it.`, PathPatterns: []*metadata.PathPattern{ &metadata.PathPattern{ HttpMethod: "POST", Pattern: "/collections/%s/templates/actions/compile", Variables: []string{"collection_id"}, Regexp: regexp.MustCompile(`/collections/([^/]+)/templates/actions/compile`), }, }, CommandFlags: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "source", Description: `The source of the CAT as a string`, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, }, ApiParams: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "source", Description: `The source of the CAT as a string`, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, }, }, &metadata.Action{ Name: "publish", Description: `Publish the given Template to the Catalog so that users can launch it.`, PathPatterns: []*metadata.PathPattern{ &metadata.PathPattern{ HttpMethod: "POST", Pattern: "/collections/%s/templates/actions/publish", Variables: []string{"collection_id"}, Regexp: regexp.MustCompile(`/collections/([^/]+)/templates/actions/publish`), }, }, CommandFlags: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "id", Description: `The ID of a Template to publish`, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "name", Description: `Optionally override the Template name for display in the Catalog`, Type: "string", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, &metadata.ActionParam{ Name: "overridden_application_href", Description: `If re-publishing, you must specify the href of the Application in the Catalog that is being overridden`, Type: "string", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, &metadata.ActionParam{ Name: "schedule_required", Description: `Whether the CloudApp requires a schedule to be provided at launch time. If set to false, allows user to pick from '24/7' schedule when launching in the UI`, Type: "bool", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, &metadata.ActionParam{ Name: "schedules[]", Description: ``, Type: "[]string", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, &metadata.ActionParam{ Name: "short_description", Description: `Optionally override the Template short description for display in the Catalog`, Type: "string", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, }, ApiParams: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "id", Description: `The ID of a Template to publish`, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "name", Description: `Optionally override the Template name for display in the Catalog`, Type: "string", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, &metadata.ActionParam{ Name: "overridden_application_href", Description: `If re-publishing, you must specify the href of the Application in the Catalog that is being overridden`, Type: "string", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, &metadata.ActionParam{ Name: "schedule_required", Description: `Whether the CloudApp requires a schedule to be provided at launch time. If set to false, allows user to pick from '24/7' schedule when launching in the UI`, Type: "bool", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, &metadata.ActionParam{ Name: "schedules[]", Description: `Schedules available to users when launching the application`, Type: "[]string", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, &metadata.ActionParam{ Name: "short_description", Description: `Optionally override the Template short description for display in the Catalog`, Type: "string", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, }, }, &metadata.Action{ Name: "unpublish", Description: `Remove a publication from the Catalog by specifying its associated Template.`, PathPatterns: []*metadata.PathPattern{ &metadata.PathPattern{ HttpMethod: "POST", Pattern: "/collections/%s/templates/actions/unpublish", Variables: []string{"collection_id"}, Regexp: regexp.MustCompile(`/collections/([^/]+)/templates/actions/unpublish`), }, }, CommandFlags: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "id", Description: `The ID of the Template to unpublish`, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, }, ApiParams: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "id", Description: `The ID of the Template to unpublish`, Type: "string", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, }, }, }, }, }
Consists of a map of resource name to resource metadata.
Functions ¶
This section is empty.
Types ¶
type Api ¶
Self-Service designer client
func New ¶
func New(accountId int, host string, auth rsapi.Authenticator, logger *log.Logger, client rsapi.HttpClient) (*Api, error)
New returns a client that uses User oauth authentication. logger and client are optional. host may be blank in which case client attempts to resolve it using auth. If no HTTP client is specified then the default client is used.
func (*Api) Dispatch ¶
func (a *Api) Dispatch(method, actionUrl string, params, payload rsapi.ApiParams) (*http.Response, error)
Dispatch request to appropriate low-level method
func (*Api) ScheduleLocator ¶
func (api *Api) ScheduleLocator(href string) *ScheduleLocator
Schedule resource locator factory
func (*Api) TemplateLocator ¶
func (api *Api) TemplateLocator(href string) *TemplateLocator
Template resource locator factory
type ApplicationInfo ¶
type FileUpload ¶
type Parameter ¶
type Parameter struct { Default interface{} `json:"default,omitempty"` Description string `json:"description,omitempty"` Name string `json:"name,omitempty"` Operations []interface{} `json:"operations,omitempty"` Type_ string `json:"type,omitempty"` Ui *ParametersUiStruct `json:"ui,omitempty"` Validation *ParametersValidationStruct `json:"validation,omitempty"` }
type ParametersUiStruct ¶
type ParametersValidationStruct ¶
type ParametersValidationStruct struct { AllowedPattern string `json:"allowed_pattern,omitempty"` AllowedValues []interface{} `json:"allowed_values,omitempty"` ConstraintDescription string `json:"constraint_description,omitempty"` MaxLength int `json:"max_length,omitempty"` MaxValue int `json:"max_value,omitempty"` MinLength int `json:"min_length,omitempty"` MinValue int `json:"min_value,omitempty"` NoEcho bool `json:"no_echo,omitempty"` }
type Recurrence ¶
type Schedule ¶
type Schedule struct { CreatedBy *User `json:"created_by,omitempty"` Description string `json:"description,omitempty"` Href string `json:"href,omitempty"` Id string `json:"id,omitempty"` Kind string `json:"kind,omitempty"` Name string `json:"name,omitempty"` StartRecurrence *Recurrence `json:"start_recurrence,omitempty"` StopRecurrence *Recurrence `json:"stop_recurrence,omitempty"` Timestamps *TimestampsStruct `json:"timestamps,omitempty"` }
A Schedule represents a recurring period during which a CloudApp should be running. It must have a unique name and an optional description. The recurrence rules follow the [Recurrence Rule format](https://tools.ietf.org/html/rfc5545#section-3.8.5.3). Multiple Schedules can be associated with a Template when published to the Catalog. Users will be able to launch the resulting CloudApp with one of the associated schedule. Updating or deleting a Schedule will not affect CloudApps that were published with that Schedule.
type ScheduleLocator ¶
type ScheduleLocator struct { UrlResolver // contains filtered or unexported fields }
Schedule resource locator, exposes resource actions.
func (*ScheduleLocator) Create ¶
func (loc *ScheduleLocator) Create(name string, startRecurrence *Recurrence, stopRecurrence *Recurrence, options rsapi.ApiParams) (*ScheduleLocator, error)
POST /collections/:collection_id/schedules Create a new Schedule.
func (*ScheduleLocator) Delete ¶
func (loc *ScheduleLocator) Delete() error
DELETE /collections/:collection_id/schedules/:id Delete a Schedule from the system. Note: deleting a Schedule from Designer doesn't remove it from the applications that were published with it to the Catalog or affect running CloudApps with that Schedule.
func (*ScheduleLocator) Index ¶
func (loc *ScheduleLocator) Index() ([]*Schedule, error)
GET /collections/:collection_id/schedules List the schedules available in Designer.
func (*ScheduleLocator) MultiDelete ¶
func (loc *ScheduleLocator) MultiDelete(ids []string) error
DELETE /collections/:collection_id/schedules Delete multiple Schedules from the system in bulk. Note: deleting a Schedule from Designer doesn't remove it from the applications that were published with it to the Catalog or affect running CloudApps with that Schedule.
func (*ScheduleLocator) Show ¶
func (loc *ScheduleLocator) Show() (*Schedule, error)
GET /collections/:collection_id/schedules/:id Show detailed information about a given Schedule.
func (*ScheduleLocator) Update ¶
func (loc *ScheduleLocator) Update(options rsapi.ApiParams) error
PATCH /collections/:collection_id/schedules/:id Update one or more attributes of an existing Schedule. Note: updating a Schedule in Designer doesn't update it in the applications that were published with it to the Catalog or affect running CloudApps with that Schedule.
type Template ¶
type Template struct { ApplicationInfo *ApplicationInfo `json:"application_info,omitempty"` CompiledCat string `json:"compiled_cat,omitempty"` CreatedBy *User `json:"created_by,omitempty"` Filename string `json:"filename,omitempty"` Href string `json:"href,omitempty"` Id string `json:"id,omitempty"` Kind string `json:"kind,omitempty"` LongDescription string `json:"long_description,omitempty"` Name string `json:"name,omitempty"` Parameters []*Parameter `json:"parameters,omitempty"` PublishedBy *User `json:"published_by,omitempty"` RequiredParameters []string `json:"required_parameters,omitempty"` ShortDescription string `json:"short_description,omitempty"` Source string `json:"source,omitempty"` Timestamps *TimestampsStruct `json:"timestamps,omitempty"` }
A Template represent a CloudApplication Template (CAT) that has been uploaded to this design collection. For information on the syntax of a CAT file, please see the [CAT Designers Guide](http://support.rightscale.com/12-Guides/Self-Service/20_Cloud_Application_Template_%28CAT%29_Designers_Guide) on the RightScale Support site. A CAT file is compiled by Self-Service to make it ready for publication and subsequent launch by users. To test your CAT file syntax, you can call the compile action with the source content. In order to Publish your CAT to the Catalog where users can launch it, it must be uploaded to Designer first, and then published to the Catalog. CAT files are uniquely identified by the name of the CloudApplication, which is specified as the "name" attribute inside of a CAT file.
type TemplateLocator ¶
type TemplateLocator struct { UrlResolver // contains filtered or unexported fields }
Template resource locator, exposes resource actions.
func (*TemplateLocator) Compile ¶
func (loc *TemplateLocator) Compile(source string) error
POST /collections/:collection_id/templates/actions/compile Compile the Template, but don't save it to Designer. Useful for debugging a CAT file while you are still authoring it.
func (*TemplateLocator) Create ¶
func (loc *TemplateLocator) Create(source *FileUpload) (*TemplateLocator, error)
POST /collections/:collection_id/templates Create a new Template by uploading its content to Designer.
func (*TemplateLocator) Delete ¶
func (loc *TemplateLocator) Delete() error
DELETE /collections/:collection_id/templates/:id Delete a Template from the system. Note: deleting a Template from Designer doesn't remove it from the Catalog if it has already been published -- see the "unpublish" action.
func (*TemplateLocator) Download ¶
func (loc *TemplateLocator) Download(apiVersion string) error
GET /collections/:collection_id/templates/:id/download Download the source of a Template.
func (*TemplateLocator) Index ¶
func (loc *TemplateLocator) Index(options rsapi.ApiParams) ([]*Template, error)
GET /collections/:collection_id/templates List the templates available in Designer along with some general details.
func (*TemplateLocator) MultiDelete ¶
func (loc *TemplateLocator) MultiDelete(ids []string) error
DELETE /collections/:collection_id/templates Delete multiple Templates from the system in bulk. Note: deleting a Template from Designer doesn't remove it from the Catalog if it has already been published -- see the "unpublish" action.
func (*TemplateLocator) Publish ¶
func (loc *TemplateLocator) Publish(id string, options rsapi.ApiParams) error
POST /collections/:collection_id/templates/actions/publish Publish the given Template to the Catalog so that users can launch it.
func (*TemplateLocator) Show ¶
func (loc *TemplateLocator) Show(options rsapi.ApiParams) (*Template, error)
GET /collections/:collection_id/templates/:id Show detailed information about a given Template. Use the views specified below for more information.
func (*TemplateLocator) Unpublish ¶
func (loc *TemplateLocator) Unpublish(id string) error
POST /collections/:collection_id/templates/actions/unpublish Remove a publication from the Catalog by specifying its associated Template.
func (*TemplateLocator) Update ¶
func (loc *TemplateLocator) Update(source *FileUpload) error
PUT /collections/:collection_id/templates/:id Update the content of an existing Template (a Template with the same "name" value in the CAT).
type TimestampsStruct ¶
type TimestampsStruct2 ¶
type UrlResolver ¶
type UrlResolver string
Url resolver produces an action URL and HTTP method from its name and a given resource href. The algorithm consists of first extracting the variables from the href and then substituing them in the action path. If there are more than one action paths then the algorithm picks the one that can substitute the most variables.
func (*UrlResolver) Url ¶
func (r *UrlResolver) Url(rName, aName string) (*metadata.ActionPath, error)