airflow.providers.amazon.aws.hooks.neptune

Classes

NeptuneHook

Interact with Amazon Neptune.

Module Contents

class airflow.providers.amazon.aws.hooks.neptune.NeptuneHook(*args, **kwargs)[source]

Bases: airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook

Interact with Amazon Neptune.

Additional arguments (such as aws_conn_id) may be specified and are passed down to the underlying AwsBaseHook.

See also

AVAILABLE_STATES = ['available'][source]
STOPPED_STATES = ['stopped'][source]
ERROR_STATES = ['cloning-failed', 'inaccessible-encryption-credentials',...[source]
wait_for_cluster_availability(cluster_id, delay=30, max_attempts=60)[source]

Wait for Neptune cluster to start.

Parameters:
  • cluster_id (str) – The ID of the cluster to wait for.

  • delay (int) – Time in seconds to delay between polls.

  • max_attempts (int) – Maximum number of attempts to poll for completion.

Returns:

The status of the cluster.

Return type:

str

wait_for_cluster_stopped(cluster_id, delay=30, max_attempts=60)[source]

Wait for Neptune cluster to stop.

Parameters:
  • cluster_id (str) – The ID of the cluster to wait for.

  • delay (int) – Time in seconds to delay between polls.

  • max_attempts (int) – Maximum number of attempts to poll for completion.

Returns:

The status of the cluster.

Return type:

str

get_cluster_status(cluster_id)[source]

Get the status of a Neptune cluster.

Parameters:

cluster_id (str) – The ID of the cluster to get the status of.

Returns:

The status of the cluster.

Return type:

str

get_db_instance_status(instance_id)[source]

Get the status of a Neptune instance.

Parameters:

instance_id (str) – The ID of the instance to get the status of.

Returns:

The status of the instance.

Return type:

str

wait_for_cluster_instance_availability(cluster_id, delay=30, max_attempts=60)[source]

Wait for Neptune instances in a cluster to be available.

Parameters:
  • cluster_id (str) – The cluster ID of the instances to wait for.

  • delay (int) – Time in seconds to delay between polls.

  • max_attempts (int) – Maximum number of attempts to poll for completion.

Returns:

The status of the instances.

Return type:

None

Was this entry helpful?