Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
APISummary string `json:"apiSummary,omitempty"`
Path string `json:"path,omitempty"`
Verb string `json:"verb,omitempty"`
Parameters []*Parameter `json:"parameters,omitempty"`
RequestBody *RequestBody `json:"requestBody,omitempty"`
Response *Response `json:"response,omitempty"`
}
Command represents a Chronosphere CLI command
func (*Command) SupportsDryRun ¶
SupportsDryRun determines in the endpoint has support for dry-run.
type Entity ¶
type Entity struct {
Name string `json:"name,omitempty"`
Create *Command `json:"create,omitempty"`
Get *Command `json:"get,omitempty"`
Update *Command `json:"update,omitempty"`
Delete *Command `json:"delete,omitempty"`
List *Command `json:"list,omitempty"`
Type *Type `json:"type,omitempty"`
IsSingleton bool
// EntityLinkedSingletonSlug holds the slug field name for singleton entities that need
// a linked identifier (e.g. "ServiceSlug" for service attributes). For normal entities
// this will be "Slug". This enables generic template handling without entity-specific logic.
EntityLinkedSingletonSlug string
}
Entity represents a Chronosphere entity exposed by the public API (e.g. a "monitor")
func (*Entity) IsNotSingleton ¶
IsNotSingleton determines if the entity is not a singleton. Helper for templates.
func (*Entity) ScaffoldYAML ¶
ScaffoldYAML returns a valid config/v1 object of the entity.
func (*Entity) SlugFieldName ¶
SlugFieldName returns the field name in the spec for slug access. For normal entities: "Slug", for linked singletons: "ServiceSlug" etc.
func (*Entity) SlugParameterName ¶
SlugParameterName returns the parameter name for slug fields. For normal entities: "Slug", for linked singletons: "ServiceSlug" etc.
func (*Entity) SlugVariableName ¶
SlugVariableName returns the variable name for slug values. For normal entities: "slug", for linked singletons: "serviceSlug" etc.
func (*Entity) SupportsForceDelete ¶
type Parameter ¶
type Parameter struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Place ParameterPlace `json:"place,omitempty"`
GoType string `json:"goType,omitempty"`
Required bool `json:"required,omitempty"`
}
Parameter represents a parameter to a Chronosphere API that must be provided by the user
func (*Parameter) FlagType ¶
FlagType returns the function name we expect to use for the given parameter type.
func (*Parameter) SwaggerName ¶
SwaggerName returns the name of the field in the Swagger generated List parameters.
type ParameterPlace ¶
type ParameterPlace string
ParameterPlace is a string that represents the location of a parameter in a request
const ( // PlacePath represents a parameter that is in the path of a request (e.g. /foo/{bar}) PlacePath ParameterPlace = "path" // PlaceQuery represents a parameter that is in the query string of a request (e.g. ?foo=bar) PlaceQuery ParameterPlace = "query" // PlaceBody represents a parameter that is in the body of a request PlaceBody ParameterPlace = "body" )
type RequestBody ¶
type RequestBody struct {
Required bool `json:"required,omitempty"`
Schema *Type `json:"schema,omitempty"`
}
RequestBody represents the request body of a Chronosphere API request
type Response ¶
type Response struct {
IsArray bool `json:"isArray,omitempty"`
Schema *Type `json:"schema,omitempty"`
}
Response represents the response from a Chronosphere API request