Documentation
¶
Index ¶
- Constants
- Variables
- type API
- type ApplicationInfo
- type Href
- 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 *rsapi.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 *rsapi.FileUpload) error
- type TimestampsStruct
- type TimestampsStruct2
- type User
Constants ¶
const APIVersion = "1.0"
API Version
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.`, Identifier: "application/vnd.rightscale.self_service.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: "stop_recurrence[hour]", Description: `The hour of day from 0 to 23.`, Type: "int", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "stop_recurrence[minute]", Description: `The minute from 0 to 59.`, Type: "int", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, &metadata.ActionParam{ Name: "stop_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: false, NonBlank: false, }, &metadata.ActionParam{ Name: "start_recurrence[minute]", Description: `The minute from 0 to 59.`, Type: "int", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, &metadata.ActionParam{ Name: "start_recurrence[rule]", Description: `A RRULE string describing the recurrence rule.`, Type: "string", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, &metadata.ActionParam{ Name: "stop_recurrence[hour]", Description: `The hour of day from 0 to 23.`, Type: "int", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, &metadata.ActionParam{ Name: "stop_recurrence[minute]", Description: `The minute from 0 to 59.`, Type: "int", Location: metadata.PayloadParam, Mandatory: false, NonBlank: false, }, &metadata.ActionParam{ Name: "stop_recurrence[rule]", Description: `A RRULE string describing the recurrence rule.`, Type: "string", Location: metadata.PayloadParam, Mandatory: false, 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.`, Identifier: "application/vnd.rightscale.self_service.template", 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", Description: `Multipart File Upload`, Type: "file", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, }, APIParams: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "source", Description: `Multipart File Upload`, Type: "*rsapi.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", Description: `Multipart File Upload`, Type: "file", Location: metadata.PayloadParam, Mandatory: true, NonBlank: false, }, }, APIParams: []*metadata.ActionParam{ &metadata.ActionParam{ Name: "source", Description: `Multipart File Upload`, Type: "*rsapi.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 ¶
API is the Self-Service designer client.
func New ¶
func New(h string, a rsapi.Authenticator) *API
New returns a Self-Service catalog API client. It makes a test API request and returns an error if authentication fails.
func (*API) BuildHTTPRequest ¶
func (a *API) BuildHTTPRequest(verb, path, version string, params, payload rsapi.APIParams) (*http.Request, error)
BuildHTTPRequest wraps the underlying rsapi implementation and simply prefixes the path with the service designer path.
func (*API) ScheduleLocator ¶
func (api *API) ScheduleLocator(href string) *ScheduleLocator
ScheduleLocator builds a locator from the given href.
func (*API) TemplateLocator ¶
func (api *API) TemplateLocator(href string) *TemplateLocator
TemplateLocator builds a locator from the given href.
type ApplicationInfo ¶
type Href ¶
type Href string
An Href contains the relative path to a resource or resource collection, e.g. "/api/servers/123" or "/api/servers".
func (*Href) ActionPath ¶
func (r *Href) ActionPath(rName, aName string) (*metadata.ActionPath, error)
ActionPath computes the path to the given resource action. For example given the href "/api/servers/123" calling ActionPath with resource "servers" and action "clone" returns the path "/api/servers/123/clone" and verb POST. The algorithm consists of extracting the variables from the href by looking up a matching pattern from the resource metadata. The variables are then substituted in the action path. If there are more than one pattern that match the href then the algorithm picks the one that can substitute the most variables.
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.
func (*Schedule) Locator ¶
func (r *Schedule) Locator(api *API) *ScheduleLocator
Locator returns a locator for the given resource
type ScheduleLocator ¶
type ScheduleLocator struct { Href // contains filtered or unexported fields }
ScheduleLocator exposes the Schedule 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.
func (*Template) Locator ¶
func (r *Template) Locator(api *API) *TemplateLocator
Locator returns a locator for the given resource
type TemplateLocator ¶
type TemplateLocator struct { Href // contains filtered or unexported fields }
TemplateLocator exposes the Template 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 *rsapi.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 *rsapi.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).