Skip to content

restore_graph_from_snapshot async

restore_graph_from_snapshot(
    snapshot_identifier: SnapshotIdentifier,
    graph_name: GraphName,
    *,
    config_overrides: Optional[AsyncNeptuneGraphClientConfig] = None,
    provisioned_memory: Optional[ProvisionedMemory] = None,
    deletion_protection: Optional[bool] = None,
    tags: Optional[TagMap] = None,
    replica_count: Optional[ReplicaCount] = None,
    public_connectivity: Optional[bool] = None,
) -> RestoreGraphFromSnapshotOutput

Restores a graph from a snapshot.

Parameters:

  • snapshot_identifier (SnapshotIdentifier) –

    The ID of the snapshot in question.

  • graph_name (GraphName) –

    A name for the new Neptune Analytics graph to be created from the snapshot.

    The name must contain from 1 to 63 letters, numbers, or hyphens, and its first character must be a letter. It cannot end with a hyphen or contain two consecutive hyphens. Only lowercase letters are allowed.

  • provisioned_memory (Optional[ProvisionedMemory], default: None ) –

    The provisioned memory-optimized Neptune Capacity Units (m-NCUs) to use for the graph.

    Min = 16

  • deletion_protection (Optional[bool], default: None ) –

    A value that indicates whether the graph has deletion protection enabled. The graph can't be deleted when deletion protection is enabled.

  • tags (Optional[TagMap], default: None ) –

    Adds metadata tags to the snapshot. These tags can also be used with cost allocation reporting, or used in a Condition statement in an IAM policy.

  • replica_count (Optional[ReplicaCount], default: None ) –

    The number of replicas in other AZs. Min =0, Max = 2, Default =1

    Additional charges equivalent to the m-NCUs selected for the graph apply for each replica.

  • public_connectivity (Optional[bool], default: None ) –

    Specifies whether or not the graph can be reachable over the internet. All access to graphs is IAM authenticated. (true to enable, or false to disable).

Raises:

Source code in docs_src/capo_neptune_graph/_services/async_neptune_graph.py
async def restore_graph_from_snapshot(
    self,
    snapshot_identifier: "capo_neptune_graph.types.snapshot_identifier.SnapshotIdentifier",
    graph_name: "capo_neptune_graph.types.graph_name.GraphName",
    *,
    config_overrides: Optional[AsyncNeptuneGraphClientConfig] = None,
    provisioned_memory: Optional[
        "capo_neptune_graph.types.provisioned_memory.ProvisionedMemory"
    ] = None,
    deletion_protection: Optional[bool] = None,
    tags: Optional["capo_neptune_graph.types.tag_map.TagMap"] = None,
    replica_count: Optional[
        "capo_neptune_graph.types.replica_count.ReplicaCount"
    ] = None,
    public_connectivity: Optional[bool] = None,
) -> "capo_neptune_graph.types.restore_graph_from_snapshot_output.RestoreGraphFromSnapshotOutput":
    """<p>Restores a graph from a snapshot.</p>

    Args:
        snapshot_identifier: <p>The ID of the snapshot in question.</p>
        graph_name: <p>A name for the new Neptune Analytics graph to be created from the snapshot.</p> <p>The name must contain from 1 to 63 letters, numbers, or hyphens, and its first character must be a letter. It cannot end with a hyphen or contain two consecutive hyphens. Only lowercase letters are allowed.</p>
        provisioned_memory: <p>The provisioned memory-optimized Neptune Capacity Units (m-NCUs) to use for the graph.</p> <p>Min = 16</p>
        deletion_protection: <p>A value that indicates whether the graph has deletion protection enabled. The graph can't be deleted when deletion protection is enabled.</p>
        tags: <p>Adds metadata tags to the snapshot. These tags can also be used with cost allocation reporting, or used in a Condition statement in an IAM policy.</p>
        replica_count: <p>The number of replicas in other AZs. Min =0, Max = 2, Default =1</p> <important> <p> Additional charges equivalent to the m-NCUs selected for the graph apply for each replica. </p> </important>
        public_connectivity: <p>Specifies whether or not the graph can be reachable over the internet. All access to graphs is IAM authenticated. (<code>true</code> to enable, or <code>false</code> to disable).</p>

    Raises:
        capo_neptune_graph.errors.conflict_exception.ConflictException: <p>Raised when a conflict is encountered.</p>
        capo_neptune_graph.errors.internal_server_exception.InternalServerException: <p>A failure occurred on the server.</p>
        capo_neptune_graph.errors.resource_not_found_exception.ResourceNotFoundException: <p>A specified resource could not be located.</p>
        capo_neptune_graph.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>A service quota was exceeded.</p>
        capo_neptune_graph.errors.throttling_exception.ThrottlingException: <p>The exception was interrupted by throttling.</p>
        capo_neptune_graph.errors.validation_exception.ValidationException: <p>A resource could not be validated.</p>
        capo_neptune_graph.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_neptune_graph.types.restore_graph_from_snapshot_input.RestoreGraphFromSnapshotInput]",
    ) -> AsyncOperationResponse[
        "capo_neptune_graph.types.restore_graph_from_snapshot_output.RestoreGraphFromSnapshotOutput"
    ]:
        import capo_neptune_graph._operations.amazon_neptune_graph.restore_graph_from_snapshot

        (
            output,
            http_response,
        ) = await capo_neptune_graph._operations.amazon_neptune_graph.restore_graph_from_snapshot.async_restore_graph_from_snapshot(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RestoreGraphFromSnapshot")
    )
    input_: capo_neptune_graph.types.restore_graph_from_snapshot_input.RestoreGraphFromSnapshotInput = {
        "snapshot_identifier": snapshot_identifier,
        "graph_name": graph_name,
    }
    if provisioned_memory is not None:
        input_["provisioned_memory"] = provisioned_memory
    if deletion_protection is not None:
        input_["deletion_protection"] = deletion_protection
    if tags is not None:
        input_["tags"] = tags
    if replica_count is not None:
        input_["replica_count"] = replica_count
    if public_connectivity is not None:
        input_["public_connectivity"] = public_connectivity

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output