Documentation ¶
Index ¶
- Constants
- Variables
- func MakeBadGateway(err error) *goa.ServiceError
- func MakeBadRequest(err error) *goa.ServiceError
- func MakeForbidden(err error) *goa.ServiceError
- func MakeInternalError(err error) *goa.ServiceError
- func MakeNotFound(err error) *goa.ServiceError
- func MakeUnauthorized(err error) *goa.ServiceError
- func NewCreateEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewDeleteEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewHideEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewIndexEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewShowEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewUnhideEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewUpdateEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewViewedPublishedTemplate(res *PublishedTemplate, view string) *publishedtemplateviews.PublishedTemplate
- func NewViewedPublishedTemplateList(res *PublishedTemplateList, view string) *publishedtemplateviews.PublishedTemplateList
- type Auther
- type Client
- func (c *Client) Create(ctx context.Context, p *CreatePayload) (res *CreateResult, err error)
- func (c *Client) Delete(ctx context.Context, p *DeletePayload) (err error)
- func (c *Client) Hide(ctx context.Context, p *HidePayload) (err error)
- func (c *Client) Index(ctx context.Context, p *IndexPayload) (res *PublishedTemplateList, err error)
- func (c *Client) Show(ctx context.Context, p *ShowPayload) (res *PublishedTemplate, err error)
- func (c *Client) Unhide(ctx context.Context, p *UnhidePayload) (err error)
- func (c *Client) Update(ctx context.Context, p *UpdatePayload) (err error)
- type ConflictError
- type CreatePayload
- type CreateResult
- type Credentials
- type CredentialsTag
- type DeletePayload
- type Endpoints
- type HidePayload
- type IndexPayload
- type Parameter
- type Permission
- type PublishedTemplate
- type PublishedTemplateCollection
- type PublishedTemplateList
- type Regexp
- type Service
- type ShowPayload
- type UnhidePayload
- type UpdatePayload
- type User
Constants ¶
const ServiceName = "PublishedTemplate"
ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.
Variables ¶
var MethodNames = [7]string{"create", "update", "hide", "unhide", "delete", "show", "index"}
MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.
Functions ¶
func MakeBadGateway ¶
func MakeBadGateway(err error) *goa.ServiceError
MakeBadGateway builds a goa.ServiceError from an error.
func MakeBadRequest ¶
func MakeBadRequest(err error) *goa.ServiceError
MakeBadRequest builds a goa.ServiceError from an error.
func MakeForbidden ¶
func MakeForbidden(err error) *goa.ServiceError
MakeForbidden builds a goa.ServiceError from an error.
func MakeInternalError ¶
func MakeInternalError(err error) *goa.ServiceError
MakeInternalError builds a goa.ServiceError from an error.
func MakeNotFound ¶
func MakeNotFound(err error) *goa.ServiceError
MakeNotFound builds a goa.ServiceError from an error.
func MakeUnauthorized ¶
func MakeUnauthorized(err error) *goa.ServiceError
MakeUnauthorized builds a goa.ServiceError from an error.
func NewCreateEndpoint ¶
func NewCreateEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewCreateEndpoint returns an endpoint function that calls the method "create" of service "PublishedTemplate".
func NewDeleteEndpoint ¶
func NewDeleteEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewDeleteEndpoint returns an endpoint function that calls the method "delete" of service "PublishedTemplate".
func NewHideEndpoint ¶
func NewHideEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewHideEndpoint returns an endpoint function that calls the method "hide" of service "PublishedTemplate".
func NewIndexEndpoint ¶
func NewIndexEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewIndexEndpoint returns an endpoint function that calls the method "index" of service "PublishedTemplate".
func NewShowEndpoint ¶
func NewShowEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewShowEndpoint returns an endpoint function that calls the method "show" of service "PublishedTemplate".
func NewUnhideEndpoint ¶
func NewUnhideEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewUnhideEndpoint returns an endpoint function that calls the method "unhide" of service "PublishedTemplate".
func NewUpdateEndpoint ¶
func NewUpdateEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewUpdateEndpoint returns an endpoint function that calls the method "update" of service "PublishedTemplate".
func NewViewedPublishedTemplate ¶
func NewViewedPublishedTemplate(res *PublishedTemplate, view string) *publishedtemplateviews.PublishedTemplate
NewViewedPublishedTemplate initializes viewed result type PublishedTemplate from result type PublishedTemplate using the given view.
func NewViewedPublishedTemplateList ¶
func NewViewedPublishedTemplateList(res *PublishedTemplateList, view string) *publishedtemplateviews.PublishedTemplateList
NewViewedPublishedTemplateList initializes viewed result type PublishedTemplateList from result type PublishedTemplateList using the given view.
Types ¶
type Auther ¶
type Auther interface { // JWTAuth implements the authorization logic for the JWT security scheme. JWTAuth(ctx context.Context, token string, schema *security.JWTScheme) (context.Context, error) }
Auther defines the authorization functions to be implemented by the service.
type Client ¶
type Client struct { CreateEndpoint goa.Endpoint UpdateEndpoint goa.Endpoint HideEndpoint goa.Endpoint UnhideEndpoint goa.Endpoint DeleteEndpoint goa.Endpoint ShowEndpoint goa.Endpoint IndexEndpoint goa.Endpoint }
Client is the "PublishedTemplate" service client.
func (*Client) Create ¶
func (c *Client) Create(ctx context.Context, p *CreatePayload) (res *CreateResult, err error)
Create calls the "create" endpoint of the "PublishedTemplate" service. Create may return the following errors:
- "not_found" (type *goa.ServiceError)
- "conflict" (type *ConflictError)
- error: internal error
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, p *DeletePayload) (err error)
Delete calls the "delete" endpoint of the "PublishedTemplate" service. Delete may return the following errors:
- "not_found" (type *goa.ServiceError)
- error: internal error
func (*Client) Hide ¶
func (c *Client) Hide(ctx context.Context, p *HidePayload) (err error)
Hide calls the "hide" endpoint of the "PublishedTemplate" service. Hide may return the following errors:
- "not_found" (type *goa.ServiceError)
- error: internal error
func (*Client) Index ¶
func (c *Client) Index(ctx context.Context, p *IndexPayload) (res *PublishedTemplateList, err error)
Index calls the "index" endpoint of the "PublishedTemplate" service.
func (*Client) Show ¶
func (c *Client) Show(ctx context.Context, p *ShowPayload) (res *PublishedTemplate, err error)
Show calls the "show" endpoint of the "PublishedTemplate" service. Show may return the following errors:
- "not_found" (type *goa.ServiceError)
- error: internal error
type ConflictError ¶
type ConflictError struct { // a unique identifier for this particular occurrence of the problem. ID string // name of error. Name string Location string // updatable indicates whether a 'create' request error can be resolved by // making an 'update' request instead. It is used to indicate whether a // resource is built-in and whether the user has permission to modify it. Updatable bool }
A template with this name already exists.
func (*ConflictError) Error ¶
func (e *ConflictError) Error() string
Error returns an error description.
func (*ConflictError) ErrorName ¶
func (e *ConflictError) ErrorName() string
ErrorName returns "ConflictError".
type CreatePayload ¶
type CreatePayload struct { // org_id identifies an organization by ID. OrgID uint // template_href is the href of the policy template to publish to the // organization. TemplateHref string // JWT token used to perform authorization Token *string // API Version, must be specified using this header APIVersion string }
CreatePayload is the payload type of the PublishedTemplate service create method.
type CreateResult ¶
type CreateResult struct {
Location string
}
CreateResult is the result type of the PublishedTemplate service create method.
type Credentials ¶ added in v1.0.6
type Credentials struct { // Name in policy template source code Name string `json:"name"` // Schemes of credentials service resource supported. Schemes []string `json:"schemes"` // Label for the auth reference Label string `json:"label"` // Description of what types of permissions need to be provided by auth. Description *string `json:"description"` // Tags is an optional filter to only show credentials matching a certain tag. Tags []*CredentialsTag `json:"tags"` }
Credentials describes a reference to an API signer in the credentials service in the policy language.
type CredentialsTag ¶ added in v1.0.6
type DeletePayload ¶
type DeletePayload struct { // org_id identifies an organization by ID. OrgID uint // template_id identifies a published template by ID. TemplateID string // JWT token used to perform authorization Token *string // API Version, must be specified using this header APIVersion string }
DeletePayload is the payload type of the PublishedTemplate service delete method.
type Endpoints ¶
type Endpoints struct { Create goa.Endpoint Update goa.Endpoint Hide goa.Endpoint Unhide goa.Endpoint Delete goa.Endpoint Show goa.Endpoint Index goa.Endpoint }
Endpoints wraps the "PublishedTemplate" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "PublishedTemplate" service with endpoints.
type HidePayload ¶
type HidePayload struct { // org_id identifies an organization by ID. OrgID uint // template_id identifies a published template by ID. TemplateID string // JWT token used to perform authorization Token *string // API Version, must be specified using this header APIVersion string }
HidePayload is the payload type of the PublishedTemplate service hide method.
type IndexPayload ¶
type IndexPayload struct { // org_id identifies an organization by ID. OrgID uint // etag is an HTTP ETag. It is typically the previous ETag value retrieved by // client if any. Service returns an empty response with HTTP status code 304 // Not Modified if value matches current value server side. Etag *string // View used to render published templates View *string // show_hidden will show templates that have been hidden if set to true. ShowHidden *bool // JWT token used to perform authorization Token *string // API Version, must be specified using this header APIVersion string }
IndexPayload is the payload type of the PublishedTemplate service index method.
type Parameter ¶
type Parameter struct { // Name of the parameter Name string `json:"name"` // Type of the parameter Type string `json:"type"` // Label to show in the UI Label string `json:"label"` // The index of this parameter in the list Index uint `json:"index"` // The category used to group parameters Category *string `json:"category"` // Description of the parameter Description *string `json:"description"` // The default value for the parameter Default interface{} `json:"default"` // no_echo determines whether the value of the parameter should be hidden in // UIs and API responses. NoEcho bool `json:"no_echo"` // List of values allowed for this parameter AllowedValues []interface{} `json:"allowed_values"` // The minimum length of a string parameter MinLength *uint `json:"min_length"` // The maximum length of a string parameter MaxLength *uint `json:"max_length"` // The minimum value of a number parmameter MinValue *float64 `json:"min_value"` // The maximum value of a number parameter MaxValue *float64 `json:"max_value"` // The regular expression pattern used to validate a string parameter AllowedPattern *Regexp `json:"allowed_pattern"` // The description used for constraints ConstraintDescription *string `json:"constraint_description"` }
Parameter defines a parameter given as input to a Policy
type Permission ¶
type Permission struct { // Name of a permission Name string `json:"name"` // Label is used in the UI Label *string `json:"label"` // List of resource names the permission is applied to Resources []string `json:"resources"` // List of action names the permission is applied to Actions []string `json:"actions"` }
Permission defines a role required in RightScale to perform actions on resources
type PublishedTemplate ¶
type PublishedTemplate struct { // id identifies a published template by ID. ID string // name is the unique name of the published template in the organization. Name string // org_id is the ID of the organization that the published template belongs to. OrgID *uint // project_id is the ID of the project that the published template is published // from. ProjectID *uint // policy_template_id is the ID of the policy template from which the published // template originated. PolicyTemplateID *string // policy_template_url is the full URL to the policy template from which the // published template originated. PolicyTemplateURL *string // policy_template_fingerprint is fingerprint of the policy template. It is // used to determine if the policy template that this was published from is // outdated. PolicyTemplateFingerprint *string // rs_pt_ver is the policy engine version. RsPtVer *uint // short_description is the short description of the published template. ShortDescription *string // long_description is the long description of the published template. The // content can be markdown. LongDescription *string // doc_link is a HTTP URI to a page containing detailed documentation for the // policy. DocLink *string // info is an arbitrary set of key/value pairs that provide additional // information such as the policy author, support contact information, etc. Info map[string]string // default_frequency defines the interval the template will be run unless set // differently during application. DefaultFrequency *string // href is the self-referential href of the published template. Href string // filename is the name of the file that was uploaded to create the policy // template. Filename *string // source is published template source code. Source *string // fingerprint is a SHA created during compilation. It is used to determine if // the policy template that this was published from is outdated. Fingerprint string // category is the type categorization of the published template. Category *string // created_by is the RightScale user that created the published template. CreatedBy *User // created_at is the published template creation timestamp in RFC3339 format. CreatedAt *string // updated_by is the RightScale user that updated the published template. UpdatedBy *User // updated_at is the published template update timestamp in RFC3339 format. UpdatedAt *string // permissions is a list of permissions required to run the policy. Permissions map[string]*Permission // required_roles is a list of governance roles, derived from permissions, // required to run the policy. RequiredRoles []string // parameters is a list of parameters required to apply the policy. Parameters map[string]*Parameter // severity defines the severity level of incidents raised from this published // template. Severity *string // built_in is a flag to indicate whether the published template is a // "built-in" RS-supplied template. BuiltIn *bool // hidden is a flag to indicate whether the published template is hidden. Hidden *bool // hidden_by is the RightScale user that marked the published template as // hidden. HiddenBy *User // hidden_at is the hidden at timestamp in RFC3339 format. HiddenAt *string // tenancy indicates whether this template can be run across multiple projects // or is restricted to a single project. Tenancy *string // credentials is a list of authorization for external APIs needed to run the // policy. Credentials map[string]*Credentials // kind is "gov#published_template". Kind string }
PublishedTemplate is the result type of the PublishedTemplate service show method.
func NewPublishedTemplate ¶
func NewPublishedTemplate(vres *publishedtemplateviews.PublishedTemplate) *PublishedTemplate
NewPublishedTemplate initializes result type PublishedTemplate from viewed result type PublishedTemplate.
type PublishedTemplateCollection ¶
type PublishedTemplateCollection []*PublishedTemplate
type PublishedTemplateList ¶
type PublishedTemplateList struct { // count is the number of published templates in the list. Count *uint // etag is an HTTP ETag for the published template list. Etag string // items is the array of published templates. Items PublishedTemplateCollection // not_modified is a flag used internally that indicates how to encode the HTTP // response (i.e. 200 or 304). NotModified *string // kind is "gov#published_template_list". Kind string }
PublishedTemplateList is the result type of the PublishedTemplate service index method.
func NewPublishedTemplateList ¶
func NewPublishedTemplateList(vres *publishedtemplateviews.PublishedTemplateList) *PublishedTemplateList
NewPublishedTemplateList initializes result type PublishedTemplateList from viewed result type PublishedTemplateList.
type Regexp ¶
type Regexp struct { // Pattern is the regular expression pattern. Pattern string `json:"pattern"` // Options are the regular expression options. Options i (case insensitve) and // m (match over newlines) supported. Options *string `json:"options"` }
Regular expression
type Service ¶
type Service interface { // Create creates an organization-scoped published template from a // project-scoped policy template. Create(context.Context, *CreatePayload) (res *CreateResult, err error) // Update updates a published template in place for an organization, by // replacing it. Any existing applied policies using the template will not be // updated; they must be deleted and recreated again. Update(context.Context, *UpdatePayload) (err error) // Hide hides a RightScale built-in template from an organization. Hide(context.Context, *HidePayload) (err error) // Unhide unhides a RightScale built-in template from an organization. Unhide(context.Context, *UnhidePayload) (err error) // Delete deletes a published template from an organization. Deleting a // published template will not delete any applied policies created from the // template, they must be stopped explicitly. Delete(context.Context, *DeletePayload) (err error) // Show retrieves the details of a published template. // The "view" return value must have one of the following views // - "default" // - "extended" // - "source" // - "link" Show(context.Context, *ShowPayload) (res *PublishedTemplate, view string, err error) // Index retrieves the list of published templates in an organization. // The "view" return value must have one of the following views // - "default" // - "extended" Index(context.Context, *IndexPayload) (res *PublishedTemplateList, view string, err error) }
Service is the PublishedTemplate service interface.
type ShowPayload ¶
type ShowPayload struct { // org_id identifies an organization by ID. OrgID uint // template_id identifies a published template by ID. TemplateID string // View used to render published template View *string // JWT token used to perform authorization Token *string // API Version, must be specified using this header APIVersion string }
ShowPayload is the payload type of the PublishedTemplate service show method.
type UnhidePayload ¶
type UnhidePayload struct { // org_id identifies an organization by ID. OrgID uint // template_id identifies a published template by ID. TemplateID string // JWT token used to perform authorization Token *string // API Version, must be specified using this header APIVersion string }
UnhidePayload is the payload type of the PublishedTemplate service unhide method.
type UpdatePayload ¶
type UpdatePayload struct { // org_id identifies an organization by ID. OrgID uint // template_id identifies a published template by ID. TemplateID string // template_href is the href of the policy template to publish to the // organization. TemplateHref string // JWT token used to perform authorization Token *string // API Version, must be specified using this header APIVersion string }
UpdatePayload is the payload type of the PublishedTemplate service update method.