ssd

package
v8.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const APIVersion = "1.0"

API Version

Variables

View Source
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:    "/api/designer/collections/%s/schedules",
						Variables:  []string{"collection_id"},
						Regexp:     regexp.MustCompile(`/api/designer/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:    "/api/designer/collections/%s/schedules/%s",
						Variables:  []string{"collection_id", "id"},
						Regexp:     regexp.MustCompile(`/api/designer/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:    "/api/designer/collections/%s/schedules",
						Variables:  []string{"collection_id"},
						Regexp:     regexp.MustCompile(`/api/designer/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:    "/api/designer/collections/%s/schedules/%s",
						Variables:  []string{"collection_id", "id"},
						Regexp:     regexp.MustCompile(`/api/designer/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:    "/api/designer/collections/%s/schedules/%s",
						Variables:  []string{"collection_id", "id"},
						Regexp:     regexp.MustCompile(`/api/designer/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:    "/api/designer/collections/%s/schedules",
						Variables:  []string{"collection_id"},
						Regexp:     regexp.MustCompile(`/api/designer/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 File Language Reference](http://docs.rightscale.com/ss/reference/ss_CAT_file_language.html) on the RightScale Docs
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:    "/api/designer/collections/%s/templates",
						Variables:  []string{"collection_id"},
						Regexp:     regexp.MustCompile(`/api/designer/collections/([^/]+)/templates`),
					},
				},
				CommandFlags: []*metadata.ActionParam{
					&metadata.ActionParam{
						Name:        "filter[]",
						Description: `Filter by name, syntax is ["name==foo"]`,
						Type:        "[]string",
						Location:    metadata.QueryParam,
						Mandatory:   false,
						NonBlank:    false,
					},
					&metadata.ActionParam{
						Name:        "ids[]",
						Description: `An optional list of template IDs to retrieve`,
						Type:        "[]string",
						Location:    metadata.QueryParam,
						Mandatory:   false,
						NonBlank:    false,
					},
					&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:        "filter[]",
						Description: `Filter by name, syntax is ["name==foo"]`,
						Type:        "[]string",
						Location:    metadata.QueryParam,
						Mandatory:   false,
						NonBlank:    false,
					},
					&metadata.ActionParam{
						Name:        "ids[]",
						Description: `An optional list of template IDs to retrieve`,
						Type:        "[]string",
						Location:    metadata.QueryParam,
						Mandatory:   false,
						NonBlank:    false,
					},
					&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:        "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:    "/api/designer/collections/%s/templates/%s",
						Variables:  []string{"collection_id", "id"},
						Regexp:     regexp.MustCompile(`/api/designer/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:    "/api/designer/collections/%s/templates",
						Variables:  []string{"collection_id"},
						Regexp:     regexp.MustCompile(`/api/designer/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:        "create_from_compilation",
				Description: `Create a new Template from a previously compiled CAT.`,
				PathPatterns: []*metadata.PathPattern{
					&metadata.PathPattern{
						HTTPMethod: "POST",
						Pattern:    "/api/designer/collections/%s/templates/actions/create_from_compilation",
						Variables:  []string{"collection_id"},
						Regexp:     regexp.MustCompile(`/api/designer/collections/([^/]+)/templates/actions/create_from_compilation`),
					},
				},
				CommandFlags: []*metadata.ActionParam{
					&metadata.ActionParam{
						Name:        "compilation_href",
						Description: `The href of the compilation`,
						Type:        "string",
						Location:    metadata.PayloadParam,
						Mandatory:   true,
						NonBlank:    false,
					},
					&metadata.ActionParam{
						Name:        "filename",
						Description: `The filename of the template`,
						Type:        "string",
						Location:    metadata.PayloadParam,
						Mandatory:   false,
						NonBlank:    false,
					},
				},
				APIParams: []*metadata.ActionParam{
					&metadata.ActionParam{
						Name:        "compilation_href",
						Description: `The href of the compilation`,
						Type:        "string",
						Location:    metadata.PayloadParam,
						Mandatory:   true,
						NonBlank:    false,
					},
					&metadata.ActionParam{
						Name:        "filename",
						Description: `The filename of the template`,
						Type:        "string",
						Location:    metadata.PayloadParam,
						Mandatory:   false,
						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:    "/api/designer/collections/%s/templates/%s",
						Variables:  []string{"collection_id", "id"},
						Regexp:     regexp.MustCompile(`/api/designer/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_from_compilation",
				Description: `Update a Template from a previously compiled CAT.`,
				PathPatterns: []*metadata.PathPattern{
					&metadata.PathPattern{
						HTTPMethod: "POST",
						Pattern:    "/api/designer/collections/%s/templates/%s/actions/update_from_compilation",
						Variables:  []string{"collection_id", "id"},
						Regexp:     regexp.MustCompile(`/api/designer/collections/([^/]+)/templates/([^/]+)/actions/update_from_compilation`),
					},
				},
				CommandFlags: []*metadata.ActionParam{
					&metadata.ActionParam{
						Name:        "compilation_href",
						Description: `The href of the compilation`,
						Type:        "string",
						Location:    metadata.PayloadParam,
						Mandatory:   true,
						NonBlank:    false,
					},
					&metadata.ActionParam{
						Name:        "filename",
						Description: `The filename of the template`,
						Type:        "string",
						Location:    metadata.PayloadParam,
						Mandatory:   false,
						NonBlank:    false,
					},
				},
				APIParams: []*metadata.ActionParam{
					&metadata.ActionParam{
						Name:        "compilation_href",
						Description: `The href of the compilation`,
						Type:        "string",
						Location:    metadata.PayloadParam,
						Mandatory:   true,
						NonBlank:    false,
					},
					&metadata.ActionParam{
						Name:        "filename",
						Description: `The filename of the template`,
						Type:        "string",
						Location:    metadata.PayloadParam,
						Mandatory:   false,
						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:    "/api/designer/collections/%s/templates/%s",
						Variables:  []string{"collection_id", "id"},
						Regexp:     regexp.MustCompile(`/api/designer/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:    "/api/designer/collections/%s/templates",
						Variables:  []string{"collection_id"},
						Regexp:     regexp.MustCompile(`/api/designer/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:    "/api/designer/collections/%s/templates/%s/download",
						Variables:  []string{"collection_id", "id"},
						Regexp:     regexp.MustCompile(`/api/designer/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:    "/api/designer/collections/%s/templates/actions/compile",
						Variables:  []string{"collection_id"},
						Regexp:     regexp.MustCompile(`/api/designer/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:        "dependencies",
				Description: `Lists the Templates which the provided CAT source or Template directly or indirectly depend upon`,
				PathPatterns: []*metadata.PathPattern{
					&metadata.PathPattern{
						HTTPMethod: "POST",
						Pattern:    "/api/designer/collections/%s/templates/actions/dependencies",
						Variables:  []string{"collection_id"},
						Regexp:     regexp.MustCompile(`/api/designer/collections/([^/]+)/templates/actions/dependencies`),
					},
				},
				CommandFlags: []*metadata.ActionParam{
					&metadata.ActionParam{
						Name:        "source",
						Description: `The source of the CAT as a string, mutually exclusive with template_id`,
						Type:        "string",
						Location:    metadata.PayloadParam,
						Mandatory:   false,
						NonBlank:    false,
					},
					&metadata.ActionParam{
						Name:        "template_id",
						Description: `The id of the template, mutually exclusive with source, have predecedence over "source" if both parameters are given`,
						Type:        "string",
						Location:    metadata.PayloadParam,
						Mandatory:   false,
						NonBlank:    false,
					},
				},
				APIParams: []*metadata.ActionParam{
					&metadata.ActionParam{
						Name:        "source",
						Description: `The source of the CAT as a string, mutually exclusive with template_id`,
						Type:        "string",
						Location:    metadata.PayloadParam,
						Mandatory:   false,
						NonBlank:    false,
					},
					&metadata.ActionParam{
						Name:        "template_id",
						Description: `The id of the template, mutually exclusive with source, have predecedence over "source" if both parameters are given`,
						Type:        "string",
						Location:    metadata.PayloadParam,
						Mandatory:   false,
						NonBlank:    false,
					},
				},
			},

			&metadata.Action{
				Name:        "dependents",
				Description: `List the Dependents templates available in Designer for the given package, even if no template actually define the package.`,
				PathPatterns: []*metadata.PathPattern{
					&metadata.PathPattern{
						HTTPMethod: "GET",
						Pattern:    "/api/designer/collections/%s/templates/actions/dependents",
						Variables:  []string{"collection_id"},
						Regexp:     regexp.MustCompile(`/api/designer/collections/([^/]+)/templates/actions/dependents`),
					},
				},
				CommandFlags: []*metadata.ActionParam{
					&metadata.ActionParam{
						Name:        "package",
						Description: `The path of the Package to which lists the dependents`,
						Type:        "string",
						Location:    metadata.QueryParam,
						Mandatory:   true,
						NonBlank:    false,
					},
					&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:        "package",
						Description: `The path of the Package to which lists the dependents`,
						Type:        "string",
						Location:    metadata.QueryParam,
						Mandatory:   true,
						NonBlank:    false,
					},
					&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:        "publish",
				Description: `Publish the given Template to the Catalog so that users can launch it.`,
				PathPatterns: []*metadata.PathPattern{
					&metadata.PathPattern{
						HTTPMethod: "POST",
						Pattern:    "/api/designer/collections/%s/templates/actions/publish",
						Variables:  []string{"collection_id"},
						Regexp:     regexp.MustCompile(`/api/designer/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:        "long_description",
						Description: `Optionally override the Template long description used mostly for designers.`,
						Type:        "string",
						Location:    metadata.PayloadParam,
						Mandatory:   false,
						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:        "long_description",
						Description: `Optionally override the Template long description used mostly for designers.`,
						Type:        "string",
						Location:    metadata.PayloadParam,
						Mandatory:   false,
						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:    "/api/designer/collections/%s/templates/actions/unpublish",
						Variables:  []string{"collection_id"},
						Regexp:     regexp.MustCompile(`/api/designer/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

type API struct {
	*rsapi.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) 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 ApplicationInfo struct {
	Href string `json:"href,omitempty"`
	Name string `json:"name,omitempty"`
}

type CatDependency

type CatDependency struct {
	Alias        string     `json:"alias,omitempty"`
	CompiledAt   *time.Time `json:"compiled_at,omitempty"`
	Name         string     `json:"name,omitempty"`
	Package      string     `json:"package,omitempty"`
	RsCaVer      int        `json:"rs_ca_ver,omitempty"`
	SourceHref   string     `json:"source_href,omitempty"`
	TemplateHref string     `json:"template_href,omitempty"`
	TemplateId   string     `json:"template_id,omitempty"`
}

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 ParametersUiStruct struct {
	Category string `json:"category,omitempty"`
	Index    int    `json:"index,omitempty"`
	Label    string `json:"label,omitempty"`
}

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 Recurrence struct {
	Hour   int    `json:"hour,omitempty"`
	Minute int    `json:"minute,omitempty"`
	Rule   string `json:"rule,omitempty"`
}

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 /api/designer/collections/:collection_id/schedules

Create a new Schedule.

func (*ScheduleLocator) Delete

func (loc *ScheduleLocator) Delete() error

DELETE /api/designer/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 /api/designer/collections/:collection_id/schedules

List the schedules available in Designer.

func (*ScheduleLocator) MultiDelete

func (loc *ScheduleLocator) MultiDelete(ids []string) error

DELETE /api/designer/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 /api/designer/collections/:collection_id/schedules/:id

Show detailed information about a given Schedule.

func (*ScheduleLocator) Update

func (loc *ScheduleLocator) Update(options rsapi.APIParams) error

PATCH /api/designer/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"`
	CompilationHref    string            `json:"compilation_href,omitempty"`
	CompiledCat        string            `json:"compiled_cat,omitempty"`
	CreatedBy          *User             `json:"created_by,omitempty"`
	Dependencies       []*CatDependency  `json:"dependencies,omitempty"`
	Dependents         []*CatDependency  `json:"dependents,omitempty"`
	Filename           string            `json:"filename,omitempty"`
	Href               string            `json:"href,omitempty"`
	Id                 string            `json:"id,omitempty"`
	Imports            []string          `json:"imports,omitempty"`
	Kind               string            `json:"kind,omitempty"`
	LongDescription    string            `json:"long_description,omitempty"`
	Name               string            `json:"name,omitempty"`
	Package            string            `json:"package,omitempty"`
	Parameters         []*Parameter      `json:"parameters,omitempty"`
	PublishedBy        *User             `json:"published_by,omitempty"`
	RequiredParameters []string          `json:"required_parameters,omitempty"`
	RsCaVer            int               `json:"rs_ca_ver,omitempty"`
	ShortDescription   string            `json:"short_description,omitempty"`
	Source             string            `json:"source,omitempty"`
	SourceHref         string            `json:"source_href,omitempty"`
	Stale              bool              `json:"stale,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 File Language Reference](http://docs.rightscale.com/ss/reference/ss_CAT_file_language.html) on the RightScale Docs 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 /api/designer/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 /api/designer/collections/:collection_id/templates

Create a new Template by uploading its content to Designer.

func (*TemplateLocator) CreateFromCompilation

func (loc *TemplateLocator) CreateFromCompilation(compilationHref string, options rsapi.APIParams) error

POST /api/designer/collections/:collection_id/templates/actions/create_from_compilation

Create a new Template from a previously compiled CAT.

func (*TemplateLocator) Delete

func (loc *TemplateLocator) Delete() error

DELETE /api/designer/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) Dependencies

func (loc *TemplateLocator) Dependencies(options rsapi.APIParams) (*Template, error)

POST /api/designer/collections/:collection_id/templates/actions/dependencies

Lists the Templates which the provided CAT source or Template directly or indirectly depend upon

func (*TemplateLocator) Dependents

func (loc *TemplateLocator) Dependents(package_ string, options rsapi.APIParams) (*Template, error)

GET /api/designer/collections/:collection_id/templates/actions/dependents

List the Dependents templates available in Designer for the given package, even if no template actually define the package.

func (*TemplateLocator) Download

func (loc *TemplateLocator) Download(apiVersion string) error

GET /api/designer/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 /api/designer/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 /api/designer/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 /api/designer/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 /api/designer/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 /api/designer/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 /api/designer/collections/:collection_id/templates/:id

Update the content of an existing Template (a Template with the same "name" value in the CAT).

func (*TemplateLocator) UpdateFromCompilation

func (loc *TemplateLocator) UpdateFromCompilation(compilationHref string, options rsapi.APIParams) error

POST /api/designer/collections/:collection_id/templates/:id/actions/update_from_compilation

Update a Template from a previously compiled CAT.

type TimestampsStruct

type TimestampsStruct struct {
	CreatedAt *time.Time `json:"created_at,omitempty"`
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
}

type TimestampsStruct2

type TimestampsStruct2 struct {
	CompiledAt  *time.Time `json:"compiled_at,omitempty"`
	CreatedAt   *time.Time `json:"created_at,omitempty"`
	PublishedAt *time.Time `json:"published_at,omitempty"`
	UpdatedAt   *time.Time `json:"updated_at,omitempty"`
}

type User

type User struct {
	Email string `json:"email,omitempty"`
	Id    int    `json:"id,omitempty"`
	Name  string `json:"name,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL