Service lifecycle manage a specific type of service on demand. Allowed tiers and requested attributes are defined by the specific implementation.
Types
Functions
provision: func(
instance-id: service-instance-id,
type: string,
tier: option<tier>,
requests: option<list<request>>,
) -> result<_, error>
Provision a new service instance based on the service type, tier and requested attributes. A lifecycle may be able to provision one or more types of services. If the service type cannot be provisioned by this lifecycle, an error is returned. A service-error is returned if the tier or attributes are invalid, or if the service could not be provisioned for any reason. A service-instance-id is returned on success which can be used to update the service instance, create bindings, or destroy the service instance.
update: func(
instance-id: service-instance-id,
tier: option<tier>,
requests: option<list<request>>,
) -> result<_, error>
Update tier or requested attributes for an existing service. An error is returned if the tier or attributes are invalid, or if the service could not be updated for any reason.
destroy: func(
instance-id: service-instance-id,
retain: option<bool>,
) -> result<_, error>
Destroys an existing service, optionally requesting that state contained within the service be retained rather than destroyed. A service-error is returned if the retention request cannot be satisfied, or if the service could not be destroyed for any reason.
bind: func(
binding-id: service-binding-id,
instance-id: service-instance-id,
scopes: option<list<scope>>,
) -> result<_, error>
Bind new credentials for the provisioned service publishing them to the credential store. Scopes limit access to the service for the binding. The specific scopes available are defined by the service. An error is returned if the scopes are invalid or the binding could not be created for any reason.
list-bindings: func(
instance-id: service-instance-id,
) -> result<list<service-binding-id>, error>
List bindings for a service instance.
unbind: func(
binding-id: service-binding-id,
instance-id: service-instance-id,
) -> result<_, error>
Unbind removes the binding. Expire any valid credentials and remove them from the credential store. An error is returned if the binding could not be released for any reason.
WIT
/// Service lifecycle manage a specific type of service on demand. Allowed tiers and requested
/// attributes are defined by the specific implementation.
interface lifecycle {
use types.{service-instance-id, service-binding-id, request, scope, tier, error};
/// Provision a new service instance based on the service type, tier and requested attributes.
/// A lifecycle may be able to provision one or more types of services. If the service type
/// cannot be provisioned by this lifecycle, an error is returned. A service-error is returned
/// if the tier or attributes are invalid, or if the service could not be provisioned for any
/// reason. A service-instance-id is returned on success which can be used to update the
/// service instance, create bindings, or destroy the service instance.
provision: func(instance-id: service-instance-id, %type: string, tier: option<tier>, requests: option<list<request>>) -> result<_, error>;
/// Update tier or requested attributes for an existing service. An error is returned
/// if the tier or attributes are invalid, or if the service could not be updated for any
/// reason.
update: func(instance-id: service-instance-id, tier: option<tier>, requests: option<list<request>>) -> result<_, error>;
/// Destroys an existing service, optionally requesting that state contained within the service
/// be retained rather than destroyed. A service-error is returned if the retention request
/// cannot be satisfied, or if the service could not be destroyed for any reason.
destroy: func(instance-id: service-instance-id, retain: option<bool>) -> result<_, error>;
/// Bind new credentials for the provisioned service publishing them to the credential store.
/// Scopes limit access to the service for the binding. The specific scopes available are
/// defined by the service. An error is returned if the scopes are invalid or the binding could
/// not be created for any reason.
bind: func(binding-id: service-binding-id, instance-id: service-instance-id, scopes: option<list<scope>>) -> result<_, error>;
/// List bindings for a service instance.
list-bindings: func(instance-id: service-instance-id) -> result<list<service-binding-id>, error>;
/// Unbind removes the binding. Expire any valid credentials and remove them from the
/// credential store. An error is returned if the binding could not be released for any reason.
unbind: func(binding-id: service-binding-id, instance-id: service-instance-id) -> result<_, error>;
}