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 MakePreconditionFailed(err error) *goa.ServiceError
- func MakeUnauthorized(err error) *goa.ServiceError
- func MakeUnprocessableEntity(err error) *goa.ServiceError
- func NewIndexEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewIndexEscalationsEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewIndexResolutionsEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewResolveEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewRunActionEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewShowEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewViewedEscalations(res *Escalations, view string) *incidentviews.Escalations
- func NewViewedIncident(res *Incident, view string) *incidentviews.Incident
- func NewViewedIncidentList(res *IncidentList, view string) *incidentviews.IncidentList
- func NewViewedResolutions(res *Resolutions, view string) *incidentviews.Resolutions
- type Action
- type AppliedPolicy
- type ApprovalRequest
- type ApprovalSubject
- type Auther
- type Client
- func (c *Client) Index(ctx context.Context, p *IndexPayload) (res *IncidentList, err error)
- func (c *Client) IndexEscalations(ctx context.Context, p *IndexEscalationsPayload) (res *Escalations, err error)
- func (c *Client) IndexResolutions(ctx context.Context, p *IndexResolutionsPayload) (res *Resolutions, err error)
- func (c *Client) Resolve(ctx context.Context, p *ResolvePayload) (err error)
- func (c *Client) RunAction(ctx context.Context, p *RunActionPayload) (res *RunActionResult, err error)
- func (c *Client) Show(ctx context.Context, p *ShowPayload) (res *Incident, err error)
- type ConfigurationOption
- type ConfigurationOptionCreateType
- type Conflict
- type Credentials
- type CredentialsTag
- type DataField
- type Endpoints
- type Escalation
- type EscalationAction
- type Escalations
- type Incident
- type IncidentCollection
- type IncidentList
- type IndexEscalationsPayload
- type IndexPayload
- type IndexResolutionsPayload
- type Parameter
- type Permission
- type PolicyTemplate
- type Project
- type PublishedTemplate
- type Regexp
- type Resolution
- type ResolutionAction
- type Resolutions
- type ResolvePayload
- type RunActionPayload
- type RunActionResult
- type Service
- type ShowPayload
- type User
Constants ¶
const ServiceName = "Incident"
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 = [6]string{"show", "index", "resolve", "index_escalations", "index_resolutions", "run_action"}
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 MakePreconditionFailed ¶
func MakePreconditionFailed(err error) *goa.ServiceError
MakePreconditionFailed builds a goa.ServiceError from an error.
func MakeUnauthorized ¶
func MakeUnauthorized(err error) *goa.ServiceError
MakeUnauthorized builds a goa.ServiceError from an error.
func MakeUnprocessableEntity ¶
func MakeUnprocessableEntity(err error) *goa.ServiceError
MakeUnprocessableEntity builds a goa.ServiceError from an error.
func NewIndexEndpoint ¶
func NewIndexEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewIndexEndpoint returns an endpoint function that calls the method "index" of service "Incident".
func NewIndexEscalationsEndpoint ¶
func NewIndexEscalationsEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewIndexEscalationsEndpoint returns an endpoint function that calls the method "index_escalations" of service "Incident".
func NewIndexResolutionsEndpoint ¶
func NewIndexResolutionsEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewIndexResolutionsEndpoint returns an endpoint function that calls the method "index_resolutions" of service "Incident".
func NewResolveEndpoint ¶
func NewResolveEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewResolveEndpoint returns an endpoint function that calls the method "resolve" of service "Incident".
func NewRunActionEndpoint ¶ added in v1.2.0
func NewRunActionEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewRunActionEndpoint returns an endpoint function that calls the method "run_action" of service "Incident".
func NewShowEndpoint ¶
func NewShowEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewShowEndpoint returns an endpoint function that calls the method "show" of service "Incident".
func NewViewedEscalations ¶
func NewViewedEscalations(res *Escalations, view string) *incidentviews.Escalations
NewViewedEscalations initializes viewed result type Escalations from result type Escalations using the given view.
func NewViewedIncident ¶
func NewViewedIncident(res *Incident, view string) *incidentviews.Incident
NewViewedIncident initializes viewed result type Incident from result type Incident using the given view.
func NewViewedIncidentList ¶
func NewViewedIncidentList(res *IncidentList, view string) *incidentviews.IncidentList
NewViewedIncidentList initializes viewed result type IncidentList from result type IncidentList using the given view.
func NewViewedResolutions ¶
func NewViewedResolutions(res *Resolutions, view string) *incidentviews.Resolutions
NewViewedResolutions initializes viewed result type Resolutions from result type Resolutions using the given view.
Types ¶
type Action ¶ added in v1.2.0
type Action struct { // id is an unique identifier for the action. ID string // type is either escalation or resolution. An escalation action is applicable // when an incident is in a triggered state. A resolution action is applicable // when an incident is resolved. Type string // label is a human readable label for the action Label *string // description provides an explanation of what happens for this action. Description *string // parameters is a list of parameters required to run the action. Parameters map[string]*Parameter // whether or not this action is automatically applied to all future incidents. Automatic *bool // kind is "gov#action". Kind string }
An action defines the steps taken when a policy is violated or when that violation is resolved.
type AppliedPolicy ¶
type AppliedPolicy struct { // id identifies an applied policy by ID. ID string // policy_aggregate_id is set if applied policy is part of an policy aggregate. PolicyAggregateID *string // incident_aggregate_id is set if applied incident is part of an policy // aggregate. IncidentAggregateID *string // name provides a name for this specific application of the policy. Name string // Project represents a RightScale project and provides some information about // the project. Project *Project // href is the href of the applied policy. Href string // policy_template links to key attributes of the policy template from which // the applied policy originated. PolicyTemplate *PolicyTemplate // published_template links to key attributes of the published template from // which the applied policy originated. PublishedTemplate *PublishedTemplate // description provides a human readable description for this specific // application of the policy. Description *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 // created_by is the RightScale user that applied the policy. CreatedBy *User // created_at is the applied policy creation timestamp in RFC3339 format. CreatedAt *string // updated_at is the applied policy update timestamp in RFC3339 format. UpdatedAt *string // severity defines the severity level of incidents raised from this applied // policy. Severity *string // category is the type categorization of the applied policy. Category *string // frequency specifies the frequency with which to run policy evaluations Frequency *string // dry_run is a flag used for testing a policy so that an incident can be // raised without performing an action. DryRun *bool // skip_approvals means that any approval actions will be skipped and all // actions automatically run. SkipApprovals *bool // options lists the configuration options used to parameterize the policy. Options []*ConfigurationOption // credentials map of credentials to use. The key in the map is the credential // name from the PolicyTemplate and the value is the credential identifier from // the Credentials management page. Credentials map[string]string // status is used to identify the current status of the applied policy. Status *string // error is the error message returned if the evaluation failed. On success // this attribute is empty. Error *string // errored_at is the applied policy error timestamp in RFC3339 format. On // success this attribute is empty. ErroredAt *string // scope is whether the policy is managed at an org-wide or project level. Scope *string // kind is "gov#applied_policy". Kind string }
AppliedPolicy describes a policy that is currently applied.
type ApprovalRequest ¶
type ApprovalRequest struct { // id identifies an approval request by ID. ID string // project_id is the ID of the project where this approval request is created. ProjectID uint // href is the href of the approval request Href string // label is a short title for this approval request Label *string // description describes the details for this approval request. Description *string // subject is the subject of the approval. Subject *ApprovalSubject // created_at is the approval request creation timestamp in RFC3339 format. CreatedAt *string // updated_at is the last update timestamp in RFC3339 format. UpdatedAt *string // parameters is a list of parameters required for approval request. Parameters map[string]*Parameter // status is the status of this approval request. Status *string // options lists the configuration options used to parameterize the approval // request. Options []*ConfigurationOption // approved_by is the RightScale user that approved this approval request. ApprovedBy *User // approved_at is the approval timestamp in RFC3339 format. ApprovedAt *string // denial_comment is a comment that explains the reason for denial, if relevant. DenialComment *string // denied_by is the RightScale user that denied this approval request. DeniedBy *User // denied_at is the denial timestamp in RFC3339 format. DeniedAt *string // kind is "gov#approval_request". Kind string }
ApprovalRequest describes an approval request to perform one or more actions
type ApprovalSubject ¶
type ApprovalSubject struct { // kind is the kind of subject Kind string // href is the href of the subject. Href string }
ApprovalSubject is the subject of an approval.
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 { ShowEndpoint goa.Endpoint IndexEndpoint goa.Endpoint ResolveEndpoint goa.Endpoint IndexEscalationsEndpoint goa.Endpoint IndexResolutionsEndpoint goa.Endpoint RunActionEndpoint goa.Endpoint }
Client is the "Incident" service client.
func NewClient ¶
func NewClient(show, index, resolve, indexEscalations, indexResolutions, runAction goa.Endpoint) *Client
NewClient initializes a "Incident" service client given the endpoints.
func (*Client) Index ¶
func (c *Client) Index(ctx context.Context, p *IndexPayload) (res *IncidentList, err error)
Index calls the "index" endpoint of the "Incident" service.
func (*Client) IndexEscalations ¶
func (c *Client) IndexEscalations(ctx context.Context, p *IndexEscalationsPayload) (res *Escalations, err error)
IndexEscalations calls the "index_escalations" endpoint of the "Incident" service. IndexEscalations may return the following errors:
- "not_found" (type *goa.ServiceError)
- error: internal error
func (*Client) IndexResolutions ¶
func (c *Client) IndexResolutions(ctx context.Context, p *IndexResolutionsPayload) (res *Resolutions, err error)
IndexResolutions calls the "index_resolutions" endpoint of the "Incident" service. IndexResolutions may return the following errors:
- "not_found" (type *goa.ServiceError)
- "unprocessable_entity" (type *goa.ServiceError)
- error: internal error
func (*Client) Resolve ¶
func (c *Client) Resolve(ctx context.Context, p *ResolvePayload) (err error)
Resolve calls the "resolve" endpoint of the "Incident" service. Resolve may return the following errors:
- "not_found" (type *goa.ServiceError)
- "precondition_failed" (type *goa.ServiceError)
- error: internal error
func (*Client) RunAction ¶ added in v1.2.0
func (c *Client) RunAction(ctx context.Context, p *RunActionPayload) (res *RunActionResult, err error)
RunAction calls the "run_action" endpoint of the "Incident" service. RunAction may return the following errors:
- "unprocessable_entity" (type *goa.ServiceError)
- "not_found" (type *goa.ServiceError)
- "conflict" (type *Conflict)
- error: internal error
type ConfigurationOption ¶
type ConfigurationOption struct { // name of option Name string // label of option Label string // type of option Type string // value of option Value interface{} // no_echo determines whether the value of the configuration option should be // hidden in UIs and API responses. NoEcho bool }
ConfigurationOption describes a single parameter value used to configure an applied policy.
type ConfigurationOptionCreateType ¶ added in v1.2.0
type ConfigurationOptionCreateType struct { // name of option Name string // value of option Value interface{} }
ConfigurationOptionCreateType is the payload for creating a single parameter value used to configure an applied policy.
type Conflict ¶ added in v1.2.0
type Conflict struct { Location string // message identifies the reason for the conflict Message string }
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 Endpoints ¶
type Endpoints struct { Show goa.Endpoint Index goa.Endpoint Resolve goa.Endpoint IndexEscalations goa.Endpoint IndexResolutions goa.Endpoint RunAction goa.Endpoint }
Endpoints wraps the "Incident" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "Incident" service with endpoints.
type Escalation ¶
type Escalation struct { // status is the status of the set of escalation actions. Status string // name is the name of the escalation. Name string // actions is the list of individual actions. Actions []*EscalationAction }
Escalation holds the status of one or more actions of an escalation.
type EscalationAction ¶
type EscalationAction struct { // type is the type of the action. Type string // status is the status of the action. Status string // started_at is the time when the action was started. StartedAt *string // finished_at is the time when the action was finished. FinishedAt *string // error is any error occurred when handling the action. Error *string // approval_request is the approval request resource (if the type is // request_approval). ApprovalRequest *ApprovalRequest // process_href is the href of a cloud workflow process. Required if the type // is cloud_workflow. ProcessHref *string }
EscalationAction holds the status of a single action in an escalation.
type Escalations ¶
type Escalations struct { // status is the status of all of the escalations. Status string // escalations is the set of escalations. Escalations []*Escalation // started_at is the time when the incident handling is started. StartedAt *string // finished_at is the time when the incident handling is finished. It exists // when the status is completed or failed. FinishedAt *string }
Escalations is the result type of the Incident service index_escalations method.
func NewEscalations ¶
func NewEscalations(vres *incidentviews.Escalations) *Escalations
NewEscalations initializes result type Escalations from viewed result type Escalations.
type Incident ¶
type Incident struct { // id is the ID of the incident, must be unique in the project. ID string // incident_aggregate_id is set if incident is part of an incident aggregate. IncidentAggregateID *string // Project represents a RightScale project and provides some information about // the project. Project *Project // href is the href of the incident. Href *string // applied_policy links to key attributes of the applied policy that initiated // the incident. AppliedPolicy *AppliedPolicy // summary is a summary of the incident. Summary *string // message is a description of the incident. Detail *string // violation_data_fields is a list of field names exported in violation data. ViolationDataFields []*DataField // violation data for the incident. ViolationData interface{} // The number of items in violation data. ViolationDataCount *uint // created_at is the incident creation timestamp in RFC3339 format. CreatedAt *string // updated_at is the incident update timestamp in RFC3339 format. UpdatedAt *string // resolved_at is the incident resolution timestamp in RFC3339 format. ResolvedAt *string // resolved_by is the RightScale user that resolved the incident if it was // resolved manually. ResolvedBy *User // resolution_message is an optional explaination of why the incident is // resolved. ResolutionMessage *string // state represents the current handling status of the incident. State *string // severity defines the severity level of the incident. Severity *string // category is the type categorization of the incident. Category *string // options lists the configuration options used to parameterize the policy that // created the incident. Options []*ConfigurationOption // dry_run is a flag used for testing a policy, that determines whether this // incident should trigger escalation actions. DryRun *bool // available_actions is a list of actions that can currently be run on the // incident. If the incident is triggered, escalation actions will be // available. If the incident is in resolved, resolution actions will be // available. If the incident is terminated, no actions are available. AvailableActions []*Action // action_failed indicates whether any of the incident's actions failed during // execution. ActionFailed *bool // kind is "gov#incident". Kind string // etag is an HTTP ETag for the incident. Etag string // not_modified is a flag used internally that indicates how to encode the HTTP // response (i.e. 200 or 304). NotModified *string }
Incident is the result type of the Incident service show method.
func NewIncident ¶
func NewIncident(vres *incidentviews.Incident) *Incident
NewIncident initializes result type Incident from viewed result type Incident.
type IncidentCollection ¶
type IncidentCollection []*Incident
type IncidentList ¶
type IncidentList struct { // count is the number of incidents in the list. Count *uint // etag is an HTTP ETag for the incident list. Etag string // items is the array of incidents. Items IncidentCollection // 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#incident_list". Kind string }
IncidentList is the result type of the Incident service index method.
func NewIncidentList ¶
func NewIncidentList(vres *incidentviews.IncidentList) *IncidentList
NewIncidentList initializes result type IncidentList from viewed result type IncidentList.
type IndexEscalationsPayload ¶
type IndexEscalationsPayload struct { // project_id identifies a project by ID. ProjectID uint // incident_id identifies an incident by ID. IncidentID string // JWT token used to perform authorization Token *string // API Version, must be specified using this header APIVersion string }
IndexEscalationsPayload is the payload type of the Incident service index_escalations method.
type IndexPayload ¶
type IndexPayload struct { // project_id identifies a project by ID. ProjectID 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 incidents View *string // state is a filter to only show incidents that are in this state. State []string // applied_policy_id is a filter to only show incidents that were created by a // certain applied policy. AppliedPolicyID *string // 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 Incident service index method.
type IndexResolutionsPayload ¶
type IndexResolutionsPayload struct { // project_id identifies a project by ID. ProjectID uint // incident_id identifies an incident by ID. IncidentID string // JWT token used to perform authorization Token *string // API Version, must be specified using this header APIVersion string }
IndexResolutionsPayload is the payload type of the Incident service index_resolutions 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 PolicyTemplate ¶
type PolicyTemplate struct { // id identifies a policy template by ID. ID string // name is the unique name of the policy template in the project. Name string // project_id is the ID of the project that the policy template applies to. ProjectID *uint // rs_pt_ver is the policy engine version. RsPtVer *uint // short_description is the short description of the policy template. ShortDescription *string // long_description is the long description of the policy template. The content // can be markdown. LongDescription *string // doc_link is an 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 href of the policy template. Href string // filename is the name of the file that was uploaded to create the policy // template. Filename *string // source is the policy template source code. Source *string // fingerprint is a SHA created during compilation. It is used to determine if // the template is outdated. Fingerprint string // category is the type categorization of the policy template. Category *string // created_by is the RightScale user that created the policy template. CreatedBy *User // created_at is the policy template creation timestamp in RFC3339 format. CreatedAt *string // updated_by is the RightScale user that updated the policy template. UpdatedBy *User // updated_at is the last 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 policy // template. Severity *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#policy_template". Kind string }
PolicyTemplate describes a previously uploaded policy template.
type Project ¶
type Project struct { // id is the Project ID ID uint // name is the Project Name Name string // org_id is the RightScale Organization ID OrgID uint // org_name is the RightScale Organization Name OrgName string }
Project represents a RightScale project and provides some information about the project.
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 describes a previously created published template.
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 Resolution ¶
type Resolution struct { // status is the status of the set of resolution actions. Status string // name is the name of the resolution. Name string // actions is the list of individual actions. Actions []*ResolutionAction }
Resolution holds the status of one or more actions of a resolution.
type ResolutionAction ¶
type ResolutionAction struct { // type is the type of the action. Type string // status is the status of the action. Status string // started_at is the time when the action was started. StartedAt *string // finished_at is the time when the action was finished. FinishedAt *string // error is any error occurred when handling the action. Error *string // approval_request is the approval request resource (if the type is // request_approval). ApprovalRequest *ApprovalRequest // process_href is the href of a cloud workflow process. Required if the type // is cloud_workflow. ProcessHref *string }
ResolutionAction holds the status of a single action in a resolution.
type Resolutions ¶
type Resolutions struct { // status is the status of all of the resolutions. Status string // resolutions is the set of resolutions. Resolutions []*Resolution // started_at is the time when the incident handling is started. StartedAt *string // finished_at is the time when the incident handling is finished. It exists // when the status is completed or failed. FinishedAt *string }
Resolutions is the result type of the Incident service index_resolutions method.
func NewResolutions ¶
func NewResolutions(vres *incidentviews.Resolutions) *Resolutions
NewResolutions initializes result type Resolutions from viewed result type Resolutions.
type ResolvePayload ¶
type ResolvePayload struct { // project_id identifies a project by ID. ProjectID uint // incident_id identifies an incident by ID. IncidentID string // message is an optional explanation for why the incident is being resolved. Message *string // 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 // JWT token used to perform authorization Token *string // API Version, must be specified using this header APIVersion string }
ResolvePayload is the payload type of the Incident service resolve method.
type RunActionPayload ¶ added in v1.2.0
type RunActionPayload struct { // project_id identifies a project by ID. ProjectID uint // action_id identifies an action by id. ActionID string // incident_id identifies an applied policy by ID. IncidentID string // options lists the configuration options used to parameterize the policy. Options []*ConfigurationOptionCreateType // JWT token used to perform authorization Token *string // API Version, must be specified using this header APIVersion string }
RunActionPayload is the payload type of the Incident service run_action method.
type RunActionResult ¶ added in v1.2.0
type RunActionResult struct {
Location string
}
RunActionResult is the result type of the Incident service run_action method.
type Service ¶
type Service interface { // Show retrieves the details of an incident. // The "view" return value must have one of the following views // - "default" // - "extended" // - "source" Show(context.Context, *ShowPayload) (res *Incident, view string, err error) // Index retrieves the list of incidents in a project. Index(context.Context, *IndexPayload) (res *IncidentList, err error) // Resolve resolves an incident by setting it to an inactive state, indicating // that it has been addressed. Resolve(context.Context, *ResolvePayload) (err error) // IndexEscalations retrieves the status details of all of the escalations for // an incident. This API method is deprecated and will no longer be updated as // of July 30, 2020. Please use the index_statuses method instead. IndexEscalations(context.Context, *IndexEscalationsPayload) (res *Escalations, err error) // IndexResolutions retrieves the status details of all of the resolutions for // an incident. This API method is deprecated and will no longer be updated as // of July 30, 2020. Please use the index_statuses method instead. IndexResolutions(context.Context, *IndexResolutionsPayload) (res *Resolutions, err error) // RunAction executes any action listed in available_actions on an incident. It // can run against all resources in an incident or only a selected amount, // depending on passed in options. Actions will run in parallel. RunAction(context.Context, *RunActionPayload) (res *RunActionResult, err error) }
Service is the Incident service interface.
type ShowPayload ¶
type ShowPayload struct { // project_id identifies a project by ID. ProjectID uint // incident_id identifies an incident by ID. IncidentID string // 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 incident 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 Incident service show method.