restoreGraphFromSnapshot method

Future<RestoreGraphFromSnapshotOutput> restoreGraphFromSnapshot({
  1. required String graphName,
  2. required String snapshotIdentifier,
  3. bool? deletionProtection,
  4. int? provisionedMemory,
  5. bool? publicConnectivity,
  6. int? replicaCount,
  7. Map<String, String>? tags,
})

Restores a graph from a snapshot.

May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter 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.

Parameter snapshotIdentifier : The ID of the snapshot in question.

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

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

Min = 16

Parameter publicConnectivity : 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).

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

Parameter tags : 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.

Implementation

Future<RestoreGraphFromSnapshotOutput> restoreGraphFromSnapshot({
  required String graphName,
  required String snapshotIdentifier,
  bool? deletionProtection,
  int? provisionedMemory,
  bool? publicConnectivity,
  int? replicaCount,
  Map<String, String>? tags,
}) async {
  _s.validateNumRange(
    'provisionedMemory',
    provisionedMemory,
    16,
    24576,
  );
  _s.validateNumRange(
    'replicaCount',
    replicaCount,
    0,
    2,
  );
  final $payload = <String, dynamic>{
    'graphName': graphName,
    if (deletionProtection != null) 'deletionProtection': deletionProtection,
    if (provisionedMemory != null) 'provisionedMemory': provisionedMemory,
    if (publicConnectivity != null) 'publicConnectivity': publicConnectivity,
    if (replicaCount != null) 'replicaCount': replicaCount,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/snapshots/${Uri.encodeComponent(snapshotIdentifier)}/restore',
    exceptionFnMap: _exceptionFns,
  );
  return RestoreGraphFromSnapshotOutput.fromJson(response);
}