Elasticsearch Instances

An Elasticsearch Instance is a restful search and analytics engine. This class inherits from TopLevelResource and has direct access to the resource’s database object. The following attributes are directly accessible:

attr resource_id:
 The primary resource identifier that takes the form of a prefix followed by numbers and letters
attr organization_service_id:
 The ID of the parent organization service (cloud)
attr instance_type:
 The type of the elasticsearch instance
attr region_name:
 The region where this elasticsearch instance resides
attr instance_id:
 The provder ID of the elasticsearch instance
attr name:The name of this elasticsearch instance
attr instance_flavor_resource_id:
 The resource ID of the type (flavor) this is instance runs on
attr network_resource_id:
 The resource ID of the parent (network)
attr state:The state of this elasticsearch instance
attr endpoint:Where you can access your elasticsearch instance
attr version:What version of elasticsearch this instance is using
attr nodes:How many nodes in this elasticsearch cluster
attr policy:JSON of the access policy attached to this elasticsearch instance
attr at_rest_encryption_enabled:
 If encryption is enabled on the elasticsearch instance
class DivvyResource.Resources.elasticsearchinstance.ElasticsearchInstance(resource_id)

Bases: DivvyResource.Resources.toplevelresource.TopLevelResource

Elasticsearch instance operations

delete(wait_for_result=True, user_resource_id=None)

Delete this resource. If wrapped in a with JobQueue() block, this will queue the deletion job to the wrapped queue, otherwise it calls immediately.

static get_db_class()

Retrieve the instance type of the resource

static get_provider_id_field()
static get_resource_type()

Retrieve the instance state

handle_resource_created(user_resource_id=None, project_resource_id=None)

This should be called when a resource is created/discovered after the basic data is added to the database. This gives an opportunity for post-addition hooks (assignment to projects/groups, alerts, etc)


This should be called when a resource is destroyed before the basic data is removed from the database. This gives an opportunity for pre-destruction hooks (removal from projects/groups, alerts, etc)

handle_resource_modified(resource, *args, **kwargs)

This should be called when a resource is modified after the new data has been updated in the DB session This gives an opportunity for post-modification hooks

top_level_resource = True