Module lsm¶
License: Inmanta EULA
Version: 2.33.5
Typedefs¶
- typedef lsm::attribute_modifier¶
Base type
string
Type constraint
(self in ['r', 'rw', 'rw+'])
- typedef lsm::attribute_set_opt¶
Base type
string
Type constraint
(self in ['candidate', 'active', 'rollback'])
- typedef lsm::labels¶
Base type
string
Type constraint
((((self == 'success') or (self == 'info')) or (self == 'warning')) or (self == 'danger'))
- typedef lsm::operation¶
Base type
string
Type constraint
/^(clear (candidate|active|rollback)|promote|rollback)$/
Entities¶
- entity lsm::EmbeddedEntity¶
Parents:
std::Entity
An entity containing attributes that should be embedded into a ServiceEntity or another EmbeddedEntity.
- attribute string[]? __lsm_key_attributes=null¶
list of attributes that uniquely identify the embedded entity. The embedded entity must have an index defined on these attribute.
- attribute dict __annotations={}¶
The annotations that should be associated with this ServiceEntity. The key-value pairs in this dictionary represent respectively the name and the value of the annotation.
The following implements statements select implementations for this entity:
std::none
constrainttrue
- entity lsm::InterServiceRelation¶
Parents:
std::Entity
An Entity used to create relations between different services. This Entity should be used as an annotation on a relationship definition and should only be used through the __service__ variable
The following implements statements select implementations for this entity:
std::none
constrainttrue
- entity lsm::LifecycleStateMachine¶
Parents:
std::Entity
The lifecycle statemachine definition.
- attribute string name¶
The name of the lifecycle used for reporting on the lifecycle
- attribute bool render_graph=false¶
When set to true the state machine is rendered to a dot graph for debug purposes.
- relation lsm::State initial_state [1]¶
- relation lsm::StateTransfer transfers [0:*]¶
The following implements statements select implementations for this entity:
std::none
constrainttrue
- entity lsm::LifecycleTransfer¶
Parents:
std::PurgeableResource
This resource reports the result of all events its receives to the LSM for handling transfers
- attribute string service_entity¶
The service entity from the service catalog.
- attribute string instance_id¶
The id of the service instance.
- attribute int next_version¶
The next version of the instance in the LSM
- attribute int? next_desired_state_version=null¶
The version of the instance’s desired state this transfer resource aims to achieve
- attribute bool purge_on_delete=false¶
- attribute string agent='internal'¶
- relation std::Resource resources [0:*]¶
The following implements statements select implementations for this entity:
std::none
constrainttrue
- entity lsm::RelationAnnotations¶
Parents:
std::Entity
An entity that holds the annotations set on a relationship.
- attribute dict annotations¶
Annotations that should be associated with a relationship.
The following implements statements select implementations for this entity:
std::none
constrainttrue
- entity lsm::RelationshipMetadata¶
Parents:
std::Entity
The metadata belonging to the relationship to an embedded entity.
- attribute lsm::attribute_modifier modifier='rw'¶
The following implements statements select implementations for this entity:
std::none
constrainttrue
- entity lsm::ServiceBase¶
Parents:
std::Entity
A baseclass used for entities that refine a service instance to resources.
- attribute bool purge_resources¶
Remove the resources associated with this service
- relation lsm::ServiceBase children [0:*]¶
- This relation connects a parent entity to its children entities. These children can be:
entities that are refined from the parent entity.
entities that are owned by the parent entity.
embedded entities that are part of the parent entity.
This relation is required to collect all resources a service consists of.
other end:
lsm::ServiceBase.parent [0:1]
- relation lsm::ServiceBase parent [0:1]¶
- This relation connects a parent entity to its children entities. These children can be:
entities that are refined from the parent entity.
entities that are owned by the parent entity.
embedded entities that are part of the parent entity.
This relation is required to collect all resources a service consists of.
other end:
lsm::ServiceBase.children [0:*]
- relation std::Resource resources [0:*]¶
A list of resources that this entity refines to. This relation will also contain all resources from entities collected through child service base entities.
- relation std::Resource owned_resources [0:*]¶
A sublist of ServiceBase.resources containing only those resources that are exclusively used by this service instance. This list is used when the lsm_partial_compile environment option is enabled to determine the resources for the resource set of this service.
The following implementations are defined for this entity:
The following implements statements select implementations for this entity:
lsm::serviceBase
constrainttrue
- entity lsm::ServiceBinding¶
Parents:
std::Entity
Binds multiple versions of a service to their corresponding entities in the model.
- attribute string service_entity_name¶
The name of the service entity that will be common to all of this entity’s versions.
- attribute int default_version=0¶
The version to use if not provided on the api endpoint. Used, for example, on the v1 catalog endpoints.
- relation lsm::ServiceBindingVersion versions [1:*]¶
The service entity binding versions of this service
other end:
lsm::ServiceBindingVersion.service [1]
The following implements statements select implementations for this entity:
std::none
constrainttrue
- entity lsm::ServiceBindingVersion¶
Parents:
std::Entity
Entity with binding configuration for a specific service entity version
- attribute string service_entity¶
The fully qualified name in the model of a service entity to register in the catalog
- attribute string? allocation_spec=null¶
name of the allocation specification for this ServiceEntityBinding, check the product documentation for more information
- attribute string? service_identity=null¶
name of the attribute to be used as a service identity
- attribute string? service_identity_display_name=null¶
The display name of the service identity, to be used by the frontend
- attribute string? relation_to_owner=null¶
the name of the InterServiceRelation to use to find the owning instance
- attribute bool strict_modifier_enforcement=true¶
Boolean value to control if strict validation of embedded entities’ attributes with respect to modifiers is on or off
- attribute int version=0¶
version of the service
- relation lsm::ServiceBindingVersion owned [0:*]¶
The ServiceBindingVersion in whose ResourceSet the resources for this entity should be placed in case of partial compile
other end:
lsm::ServiceBindingVersion.owner [0:1]
- relation lsm::ServiceBindingVersion owner [0:1]¶
The ServiceBindingVersion in whose ResourceSet the resources for this entity should be placed in case of partial compile
other end:
lsm::ServiceBindingVersion.owned [0:*]
- relation lsm::LifecycleStateMachine lifecycle [1]¶
The statemachine that represents the lifecycle
- relation lsm::ServiceBinding service [1]¶
The service entity binding versions of this service
other end:
lsm::ServiceBinding.versions [1:*]
The following implements statements select implementations for this entity:
std::none
constrainttrue
- entity lsm::ServiceEntity¶
Parents:
lsm::ServiceBase
A high level service that become available in the service catalog of the LSM. Based on this definition a service entity is generated in the catalog and an API endpoint becomes available in the service inventory.
Attributes starting with ‘_’ are excluded from the API specification. Attributes starting with ‘__’ are treated as metadata for the ServiceEntity. The values are taken from the defaults.
Service attributes are defined by adding an attribute to this entity. Metadata is specified by adding attributes with default values that start with the name of the attribute, a double underscore and then the name of the metadata. For example, for the attribute service_id, service_id__modifier provides the modifier of the service_id attribute. The following metadata is available. - modifier: Defines when the attribute can be set. See the type definition for more information.
- attribute std::uuid instance_id¶
A unique id allocated by the LSM for each service instance.
- attribute dict __annotations={}¶
Annotations that should be associated with this ServiceEntity. The key-value pairs in this dictionary represent respectively the name and the value of the annotation.
- relation lsm::State current_state [1]¶
A reference to the current state the state machine is in.
- relation lsm::ServiceBindingVersion entity_binding [1]¶
The binding of the service entity to a LSM service version
The following implementations are defined for this entity:
The following implements statements select implementations for this entity:
constraint
true
lsm::stateConfig
constrainttrue
lsm::setResourceSet
constrainttrue
- entity lsm::ServiceEntityBinding¶
Parents:
lsm::ServiceBinding
,lsm::ServiceBindingVersion
Instances of this entity are used to bind unversioned entities to the service catalog. This entity is both a service and a binding. This entity disables strict_modifier_enforcement and is maintained for legacy reasons.
- attribute bool strict_modifier_enforcement=false¶
The following implementations are defined for this entity:
The following implements statements select implementations for this entity:
lsm::setService
constrainttrue
- entity lsm::ServiceEntityBindingV2¶
Parents:
lsm::ServiceEntityBinding
Version 2 of the ServiceEntityBinding entity. In contrast to the ServiceEntityBinding entity, this entity enabled strict_modifier_enforcement by default.
- attribute bool strict_modifier_enforcement=true¶
The following implements statements select implementations for this entity:
constraint
true
- entity lsm::ServiceInstance¶
Parents:
std::PurgeableResource
Instances of this entity are instances of a service entity in the catalog
- attribute string service_entity¶
The name of the service entity this instance belongs to
- attribute std::uuid instance_id¶
ID of this instance
- attribute dict attributes¶
The desired attributes of this instance. The attribute names and types are determined by the service entity
- attribute string[] skip_update_states¶
The Lifecycle States where updating the service instance is not possible, and should be marked as skipped
- attribute string[] rejected_states¶
A list of unrecoverable states. The ServiceInstance resource will end up in the failed state when the service instance is in one of these rejected_states. In a rejected state the resource can only be purged.
- attribute bool purge_on_delete=false¶
- attribute string agent='internal'¶
The following implements statements select implementations for this entity:
std::none
constrainttrue
- entity lsm::State¶
Parents:
std::Entity
A state in the state machine
- attribute string name¶
The name of a state
- attribute lsm::labels? label=null¶
A label that is used in the UI
- attribute bool export_resources¶
Indicates whether the resources of a service instance should be exported when that service instance is in this state.
- attribute lsm::attribute_set_opt? validate_self=null¶
The attribute set of a service instance that should be taken into account when that service instance is being validated while it is in this state of its lifecycle.
- attribute lsm::attribute_set_opt? validate_others=null¶
The attribute set of a service instance that should be taken into account when that service instance is involved in the validation of another service instance while it is in this state of its lifecycle.
- attribute lsm::attribute_set_opt? previous_attr_set_on_export=null¶
The attribute set with which to compare the candidate set to determine added and removed embedded entities when the service instance is in this state of its lifecycle during an exporting compile.
- attribute lsm::attribute_set_opt? previous_attr_set_on_validate=null¶
The attribute set with which to compare the candidate set to determine added and removed embedded entities when the service instance is in this state of its lifecycle during a validation compile.
- attribute bool purge_resources=false¶
Should the service purge resources
- attribute bool deleted=false¶
The service is marked as deleted. This indicates the lifecycle has ended.
- attribute dict values={}¶
A dictionary with values associated with this state. Use the api::fsmvalue plugin to access a value.
The following implements statements select implementations for this entity:
std::none
constrainttrue
- entity lsm::StateTransfer¶
Parents:
std::Entity
- Configure an allowed state transfer. In a state machine transfers have to adhere to the following rules:
if multiple transfers between two states, only one active transfer can have auto set to true
- attribute bool on_update=false¶
Trigger this state transfer when the service is updated (API)
- attribute bool on_delete=false¶
Trigger this state transfer when the service is deleted (API)
- attribute bool api_set_state=false¶
Allow this state transfer using the API.
- attribute bool resource_based=false¶
Do the state transfer using a StateParam resource. The state transfer either happens always, or when there are requires, when these requires are deployed.
- attribute bool auto=false¶
The lifecycle manager executes this step automatically when it gets to the from state. Used often in combination with validate. Auto transfers can be configured to conditionally trigger via the config_name attribute.
- attribute bool validate=false¶
Run a compiler validation step when following this state transfer.
- attribute string? description=null¶
name of description to aid debugging
- attribute string? config_name=null¶
For auto transfers only, an optional configuration name that determines whether this transfer is enabled or not.
- attribute lsm::operation? target_operation=null¶
The operation to perform on the attribute sets when the transfer goes to the target state.
- attribute lsm::operation? error_operation=null¶
The operation to perform on the attribute sets when the transfer goes to the error state.
- attribute bool target_same_desired_state=false¶
If this transfer to the target state preserves the desired state
- attribute bool error_same_desired_state=false¶
If this transfer to the error state preserves the desired state
- relation lsm::State source [1]¶
The start of the transfer edge
- relation lsm::State target [1]¶
The end of the transfer edge
- relation lsm::State error [0:1]¶
The target state in cause of failure. There is an implicit error edge for each statetransfer to this error state.
The following implements statements select implementations for this entity:
std::none
constrainttrue
Implementations¶
- implementation lsm::serviceBase¶
- implementation lsm::setResourceSet¶
Associate a resource set with this ServiceEntity.
- implementation lsm::setService¶
A ServiceEntityBinding is a service in which the only available version is itself
- implementation lsm::stateConfig¶
This implementation configures the state machine
Plugins¶
- lsm.all(service: 'lsm::ServiceBinding', min_version: 'int' = None, max_version: 'int' = None, include_embedded_entities_id: 'bool' = False, include_purged_embedded_entities: 'bool' = False, added_attribute: 'string' = _added, removed_attribute: 'string' = _removed) 'list' ¶
Returns a list of records for the given binding.
- Parameters:
service – The service that we are unrolling
include_embedded_entities_id – Set to True to make sure all embedded entities which are part of each instance attributes have an identity baked in, to allow the usage of the lsm::get_previous_value plugin.
include_purged_embedded_entities – Set to True to enable tracking embedded entities added or removed during an update. At each step of the update, relevant embedded entities will be flagged as added or removed by the lsm::all plugin. In practise, this means the _added or the _removed boolean attributes will be set on the relevant embedded entities. To use different flagging attributes, use the added_attribute and the removed_attribute parameters.
min_version – The minimum service_entity_version of the selected instances (including this version). If left empty, there is no minimum boundary.
max_version – The maximum service_entity_version of the selected instances (including this version). If left empty, there is no maximum boundary.
added_attribute – Use in conjunction with include_purged_embedded_entities=True to set the name of the attribute flagging embedded entities that were added during an update.
removed_attribute – Use in conjunction with include_purged_embedded_entities=True to set the name of the attribute flagging embedded entities that were removed during an update.
- Returns:
A list of dict with all the defined records.
- lsm.context_v2_unwrapper(assignments: 'dict[]', fallback_attribute: 'string', track_deletes: 'bool' = False) 'dict[]' ¶
This plugin can be used to wrap the instances coming out of lsm::all and place all allocated values in :param fallback_attribute: where they should go. The returned value is what has been given as input, except for the allocated values being set where they should. :param track_deletes: drop deleted embedded entities, even if they still exist in the fallback set.
This should be used together with ContextV2Wrapper allocator.
Each assignment is an attribute dict containing a fallback attribute assigned with allocated values as produced by the ContextV2 (one-level deep, keys are string representation of the paths, values are allocated values) and update the dict placing values where their key-path would reach them.
- Parameters:
assignments – The list of service instance dictionaries as returned by lsm::all
fallback_attributes – The attribute name at the root of the instance attributes that contains all the allocated values
e.g.:
context_v2_unwrapper( [ { "environment": "8f7bf3a5-d655-4bcb-bbd4-6222407be999", "id": "f93acfad-7894-4a12-9770-b27cbdd85c74", "service_entity": "carrierEthernetEvc", "version": 4, "config": {}, "state": "allocating", "attributes": { "allocated": { "evcEndPoints[identifier=my-evc-ep-1].uni": { "uniref": "inmanta:456-852-789", "test_value": "test_value", }, "evcEndPoints[identifier=my-evc-ep-2].uni": { "uniref": "inmanta:123-852-456", "test_value": "test_value", }, }, "another_key": "any value", }, "candidate_attributes": { "allocated": { "evcEndPoints[identifier=my-evc-ep-1].uni": { "uniref": "inmanta:456-852-789", "test_value": "test_value", }, "evcEndPoints[identifier=my-evc-ep-2].uni": { "uniref": "inmanta:123-852-456", "test_value": "test_value", }, }, "another_key": "any value", }, "active_attributes": {}, "rollback_attributes": {}, } ], "allocated", )
will return:
[ { "environment": "8f7bf3a5-d655-4bcb-bbd4-6222407be999", "id": "f93acfad-7894-4a12-9770-b27cbdd85c74", "service_entity": "carrierEthernetEvc", "version": 4, "config": {}, "state": "allocating", "attributes": { "allocated": { "evcEndPoints[identifier=my-evc-ep-1].uni": { "uniref": "inmanta:456-852-789", "test_value": "test_value", }, "evcEndPoints[identifier=my-evc-ep-2].uni": { "uniref": "inmanta:123-852-456", "test_value": "test_value", }, }, "evcEndPoints": [ { "identifier": "my-evc-ep-1", "uni": { "uniref": "inmanta:456-852-789", "test_value": "test_value", }, }, { "identifier": "my-evc-ep-2", "uni": { "uniref": "inmanta:123-852-456", "test_value": "test_value", }, }, ], "another_key": "any value", }, "candidate_attributes": { "allocated": { "evcEndPoints[identifier=my-evc-ep-1].uni": { "uniref": "inmanta:456-852-789", "test_value": "test_value", }, "evcEndPoints[identifier=my-evc-ep-2].uni": { "uniref": "inmanta:123-852-456", "test_value": "test_value", }, }, "evcEndPoints": [ { "identifier": "my-evc-ep-1", "uni": { "uniref": "inmanta:456-852-789", "test_value": "test_value", }, }, { "identifier": "my-evc-ep-2", "uni": { "uniref": "inmanta:123-852-456", "test_value": "test_value", }, }, ], "another_key": "any value", }, "active_attributes": {}, "rollback_attributes": {}, } ]
- lsm.current_state(fsm: 'lsm::ServiceEntity') 'dict' ¶
Returns the current state from the lifecycle and the next version of the instance
- lsm.format(__string: 'string', args: 'list', kwargs: 'dict') 'string' ¶
Format a string using python string formatter, and accepting statements which native inmanta f-string doesn’t support (such as accessing dict values)
- Parameters:
__string – The string to apply formatting to
args – The positional arguments to feed into the str.format method
kwargs – The keyword arguments to feed into the str.format method
- lsm.fsm_to_dot(config: 'lsm::LifecycleStateMachine') 'string' ¶
Generate a dot representation of the state machine
- lsm.get_previous_attributes(instance: 'dict') 'dict?' ¶
Get the previous attributes set for a given instance if it is in an updating state. The selected attribute set depends on whether the instance is being validated or not
- Parameters:
instance – Map representation of the instance
- lsm.get_previous_value(instance_element: 'dict', attribute: 'string', *, default: 'any' = None) 'any' ¶
Get the value that a specific attribute had previously. This plugin can be called in update states, when unrolling an lsm service, to figure out if a specific attribute has been modified during the update.
The plugin can be called at the root of the instance dict, or on any embedded entity that is part of the current attributes of the instance. Each embedded entity is expected to have the following keys set, which is automatically added when using lsm::all with include_embedded_entities_id=true.
- Parameters:
instance_element – A dict that is either an instance coming out of lsm::all, or a part of the attributes dict of an instance coming out of lsm::all.
attribute – The name of an attribute that is supposed to exist on the current instance_element, in the previous version of the attributes.
default – A value to return in case the attribute doesn’t exist in the previous version of the attributes. Either because it never existed, or because the embedded entity it is a part of didn’t exist, or because we are not in an updating state (meaning there is no notion of previous attributes in that case).
- lsm.get_service_binding_version(service: 'lsm::ServiceBinding', version: 'int') 'lsm::ServiceBindingVersion' ¶
Filters the specific binding version from a service
- Parameters:
service – The ServiceBinding that groups the different ServiceBindingVersions
version – The version that we want to fetch
- Returns:
The ServiceBindingVersion that matches the version that we provided
- lsm.has_current_state(service_instance: 'lsm::ServiceEntity', state_name: 'string') 'bool' ¶
Check whether the given service instance is currently in the given state of its lifecycle.
- Parameters:
service_instance – The ServiceEntity object.
state_name – The name of the lifecycle state
- lsm.insert_embedded_entities_id(instances: 'dict[]') 'dict[]' ¶
Extend the instance attributes with information about the identity of each embedded entity that is part of it. This includes the id of the service it is part of (in the _instance_id attribute) and the dict path that leads to this specific entity, from the root of the instance attributes (in the _path attribute).
- Parameters:
instances – The instances, as returned by lsm::all, which should get augmented with the embedded entities identities. All injected attributes (_instance_id and _path) are only added to the attributes attribute of the instance.
- lsm.insert_purged_embedded_entities(instances: 'dict[]', *, removed_attribute: 'string' = _removed, added_attribute: 'string' = _added) 'dict[]' ¶
Update the instances in the provided list to include in the current attribute set all the embedded entities that have been removed in the current update. If no update is happening for an instance, its attributes are left untouched.
- Parameters:
instances – The list of instance to update, the original dicts are not modified, the returned values are a modified copy. Instances can be of different types.
removed_attribute – The attribute that should be inserted in the embedded entities which are inserted back into the current state, to mark the entity as purged.
added_attribute – The attribute that should be inserted in the embedded entities which are added into the current state, to mark the entity as “new”.
- lsm.is_validating(instance_id: 'string') 'bool' ¶
Return true if the current compile is a validating compile and the instance being validated has the given id.
- Parameters:
instance_id – The id of the instance we want to check for validation.
- lsm.render_dot(fsm: 'lsm::LifecycleStateMachine')¶
Render a dot graph in the current directory
- lsm.update_read_only_attribute(service: 'lsm::ServiceEntity', attribute_path: 'string', *, value: 'any') 'any' ¶
Update the value of a read-only (candidate) attribute in the service, in any compile, at any time. The value will first be compared to the previous set value, and only be sent to the server if it is different.
- Parameters:
service – The service on which we want to set the value
attribute_path – The path towards the service attribute
value – The new value that we want to make sure is currently written in the service.
- lsm.validate_service_index(binding: 'lsm::ServiceBindingVersion', attributes: 'dict', ignored_states: 'string[]' = []) 'bool' ¶
Validate that amongst all the services of the given binding that should be taken into account in this compile, only one of them has the provided set of attributes names and values.
- Parameters:
binding – The binding for which we want to check the services.
attributes – The attributes that we are looking for, the keys should be the attributes names, and the values the expected values.
- lsm::allocators.allocate_value(service: 'lsm::ServiceEntity', attribute_path: 'string', *, value: 'any') -> 'any'
This simple allocator allows to store a value that we already know in the model in the service (mostly to make it more visible).
- Parameters:
value – The value to save in the service attributes.
- lsm::allocators.combine_used_values(used_list: 'list') -> 'any'
- lsm::allocators.get_first_free_integer(service: 'lsm::ServiceEntity', attribute_path: 'string', *, range_start: 'int', range_end: 'int', used_values: 'any') -> 'int'
Get the first free integer in the given range.
Check all services of the same type as the provided service for the value at attribute_path. Services can be filtered out by using the filters parameter. The filters parameters take as key the path to an attribute in the service and as value the attribute value that the service is expected at this path. If the value is no match, the service is ignored.
- Parameters:
range_start – The lowest value that can be allocated.
range_end – The highest value that can be allocated.
used_values – A UsedValues object, as defined in inmanta_plugins.lsm.allocators.
- lsm::allocators.get_service_used_values(service: 'lsm::ServiceEntity', attributes_path: 'string', *, attribute_sets: 'string[]?' = None, attribute_sets_matching: 'dict?' = None) -> 'any'
Get all the values used by this service at the given attribute path. The path can be a wild dict path, making use of wild cards to select multiple values within this service.
The values are checked in each resource set of the service. Some attributes sets can be excluded by providing a value to the attribute_sets param. When this is provided, we will only consider the attributes sets which are provided in the parameter.
The value returned by this plugin can not be used within the model. It can only be used as input for a V3 allocator.
- Parameters:
service – The service in which we should look for the values.
attributes_path – The wild dict path that points to the attributes we want to get the values of.
attribute_sets – A list of attribute sets to consider when looking for a value. By default, check all attribute sets.
attribute_sets_matching – A dict taking as key dict_path expressions, and as values literals. The dict will then be used to filter the instances in which we should look for the usage of values. Any attribute set for which any of the value at the given path doesn’t match the value in this dict, will be left out.
- lsm::allocators.get_used_values(binding: 'lsm::ServiceEntityBindingV2', attributes_path: 'string', *, states: 'string[]?' = None, attribute_sets: 'string[]?' = None, attribute_sets_matching: 'dict?' = None) -> 'any'
Get all the values used by the services of this binding at the given attribute path. The path can be a wild dict path, making use of wild cards to select multiple values within one service.
The values are checked in each resource set of each service in the inventory. Some attributes sets can be excluded by providing a value to the attribute_sets param. Some states can be excluded by providing a value to the states param. When those parameters are provided, we will only consider the attributes sets or states which are provided in the parameter.
The value returned by this plugin can not be used within the model. It can only be used as input for a V3 allocator.
- Parameters:
binding – The binding defining the service in the catalog.
attributes_path – The wild dict path that points to the attributes we want to get the values of.
attribute_sets – A list of attribute sets to consider when looking for a value. By default, check all attribute sets.
attribute_sets_matching – A dict taking as key dict_path expressions, and as values literals. The dict will then be used to filter the instances in which we should look for the usage of values. Any attribute set for which any of the value at the given path doesn’t match the value in this dict, will be left out.
states – A list of states to consider when looking for a value. By default, check all states. Any service that is not in one of the provided states is skipped.
- lsm::allocators.reallocate_value(service: 'lsm::ServiceEntity', attribute_path: 'string', previous_value: 'any' = None, *, value: 'any') -> 'any'
This simple allocator allows to store a value that we already know in the model in the service (mostly to make it more visible). The difference with allocate_value is that this one will be called for any validation compile our service is in.
- Parameters:
value – The value to save in the service attributes.
Resources¶
- class lsm.LifecycleTransferResource¶
A resource that collects deploy events and send them to the lsm
Resource for entity
lsm::LifecycleTransfer
Id attribute
instance_id
Agent name
agent
Handlers
lsm.LifecycleTransferHandler
- class lsm.ServiceInstanceResource¶
Resource for entity
lsm::ServiceInstance
Id attribute
instance_id
Agent name
agent
Handlers
lsm.ServiceInstanceHandler
Handlers¶
- class lsm.LifecycleTransferHandler¶
A handler that collects all resource statuses from resources that are part of a service instance. The deploy() method is used to determine whether the resources of a service instance are deployed successfully or not.
Handler for entity
lsm::LifecycleTransfer
- class lsm.ServiceInstanceHandler¶
Handler for entity
lsm::ServiceInstance