Documentation ¶
Overview ¶
wireformat package contains wireformat structs intended for plan management API.
Index ¶
- type Authorization
- type AuthorizationQuery
- type AuthorizationRequest
- type CharmPlanDetail
- type Event
- type Plan
- type PlanActive
- type PlanDetails
- type PlanID
- type PlanURL
- type ResellerAuthorization
- type ResellerAuthorizationQuery
- type ResellerAuthorizationRequest
- type ServicePlanResponse
- type UUIDResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorization ¶
type Authorization struct { AuthorizationID string `json:"authorization-id"` // TODO(cmars): rename to AuthUUID & auth-uuid User string `json:"user"` PlanURL string `json:"plan"` EnvironmentUUID string `json:"env-uuid"` CharmURL string `json:"charm-url"` ServiceName string `json:"service-name"` CreatedOn time.Time `json:"created-on"` CredentialsID string `json:"credentials-id"` PlanDefinition string `json:"plan-definition,omitempty"` PlanID string `json:"plan-id,omitempty"` }
Authorization defines the struct containing information on an issued request for a plan authorization macaroon.
func (*Authorization) UnmarshalJSON ¶
func (a *Authorization) UnmarshalJSON(data []byte) error
UnmarshalJSON implements a transitional json.Unmarshaler to allow forward-compatible processing of fields renamed in Juju 2.0.
type AuthorizationQuery ¶
type AuthorizationQuery struct { AuthorizationID string `json:"authorization-id"` // TODO(cmars): rename to AuthUUID & auth-uuid User string `json:"user"` PlanURL string `json:"plan"` EnvironmentUUID string `json:"env-uuid"` CharmURL string `json:"charm-url"` ServiceName string `json:"service-name"` IncludePlan bool `json:"include-plan"` StatementPeriod string `json:"statement-period"` }
AuthorizationQuery defines the struct used to query authorization records.
func (*AuthorizationQuery) UnmarshalJSON ¶
func (a *AuthorizationQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON implements a transitional json.Unmarshaler to allow forward-compatible processing of fields renamed in Juju 2.0.
type AuthorizationRequest ¶
type AuthorizationRequest struct { EnvironmentUUID string `json:"env-uuid"` CharmURL string `json:"charm-url"` ServiceName string `json:"service-name"` PlanURL string `json:"plan-url"` }
AuthorizationRequest defines the struct used to request a plan authorization.
func (*AuthorizationRequest) UnmarshalJSON ¶
func (ar *AuthorizationRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements a transitional json.Unmarshaler to allow forward-compatible processing of fields renamed in Juju 2.0.
func (AuthorizationRequest) Validate ¶
func (s AuthorizationRequest) Validate() error
Validate checks the AuthorizationRequest for errors.
type CharmPlanDetail ¶
type Event ¶
type Event struct { User string `json:"user"` // user who triggered the event Type string `json:"type"` // type of the event Time time.Time `json:"time"` // timestamp }
Event defines the wireformat for a backend.event
type Plan ¶
type Plan struct { Id string `json:"id"` // Full id of the plan format URL string `json:"url"` // Name of the rating plan Definition string `json:"plan"` // The rating plan source CreatedOn string `json:"created-on"` // When the plan was created - RFC3339 encoded timestamp PlanDescription string `json:"description"` PlanPrice string `json:"price"` Released bool `json:"released"` EffectiveTime *time.Time `json:"effective-time,omitempty"` Model interface{} `json:"model,omitempty"` // The rating plan model }
Plan structure is used as a wire format to store information on ISV-created rating plan and charm URLs for which the plan is valid.
type PlanActive ¶
PlanActive structure adds an active field to the plan wireformat.
type PlanDetails ¶
type PlanDetails struct { Plan Plan `json:"plan"` Created Event `json:"created-event"` Released *Event `json:"released-event,omitempty"` Charms []CharmPlanDetail `json:"charms,omitempty"` }
PlanDetails defines the wireformat for a plan with details abouts historical lifecycle.
type PlanID ¶
PlanID identifies a plan revision.
func ParsePlanID ¶
ParsePlanID parses the string representation of a plan ID. Canonical string format is: owner/name/revision
func ParsePlanIDWithOptionalRevision ¶
ParsePlanIDWithOptionalRevision parses the string representation of a plan ID. If revision is not specified, it will be set to 0. Canonical string format is: owner/name/revision
type PlanURL ¶
PlanURL holds the components of a plan url.
func ParsePlanURL ¶
ParsePlanURL converts a plan url in canonical string format into a PlanURL. Canonical string format is: owner/name
func (PlanURL) Revision ¶
Revision generates a PlanID based on the PlanURL and provided revision number.
type ResellerAuthorization ¶
type ResellerAuthorization struct { AuthUUID string `json:"auth-uuid"` Plan string `json:"plan"` CharmURL string `json:"charm-url"` Application string `json:"application"` ApplicationOwner string `json:"owner"` ApplicationUser string `json:"user"` Credentials []byte `json:"credentials"` CreatedOn time.Time `json:"created-on"` PlanDefinition string `json:"plan-definition,omitempty"` PlanID string `json:"plan-id,omitempty"` }
ResellerAuthorization defines the struct containing information on an issued reseller plan authorization.
type ResellerAuthorizationQuery ¶
type ResellerAuthorizationQuery struct { AuthUUID string `json:"auth-uuid"` Application string `json:"application"` Reseller string `json:"reseller"` User string `json:"user"` IncludePlan bool `json:"include-plan"` StatementPeriod string `json:"statement-period"` }
ResellerAuthorizationQuery defines the struct used to query reseller authorization records.
func (ResellerAuthorizationQuery) Validate ¶
func (q ResellerAuthorizationQuery) Validate() error
Validate validates the ResellerAuthorizationQuery.
type ResellerAuthorizationRequest ¶
type ResellerAuthorizationRequest struct { Application string `json:"application"` // The reseller of the application. ApplicationOwner string `json:"application-owner"` // User consuming resources provided by the application. ApplicationUser string `json:"application-user"` Plan string `json:"plan"` CharmURL string `json:"charm-url"` }
ResellerAuthorizationRequest defines the struct resellers use to obtain authorization credentials.
func (ResellerAuthorizationRequest) Validate ¶
func (r ResellerAuthorizationRequest) Validate() error
Validate checks the ResellerAuthorizationRequest for errors.
type ServicePlanResponse ¶
type ServicePlanResponse struct { CurrentPlan string `json:"current-plan"` AvailablePlans map[string]Plan `json:"available-plans"` }
ServicePlanResponse defines the response for getServicePlan.
type UUIDResponse ¶
type UUIDResponse struct {
UUID string `json:"uuid"`
}
UUIDResponse defines a response that just contains a uuid.