createGraph method

Future<CreateGraphOutput> createGraph({
  1. required String graphName,
  2. required int provisionedMemory,
  3. bool? deletionProtection,
  4. String? kmsKeyIdentifier,
  5. bool? publicConnectivity,
  6. int? replicaCount,
  7. Map<String, String>? tags,
  8. VectorSearchConfiguration? vectorSearchConfiguration,
})

Creates a new Neptune Analytics graph.

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

Parameter graphName : A name for the new Neptune Analytics graph to be created.

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 provisionedMemory : The provisioned memory-optimized Neptune Capacity Units (m-NCUs) to use for the graph. Min = 16

Parameter deletionProtection : Indicates whether or not to enable deletion protection on the graph. The graph can’t be deleted when deletion protection is enabled. (true or false).

Parameter kmsKeyIdentifier : Specifies a KMS key to use to encrypt data in the new graph.

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 new graph. These tags can also be used with cost allocation reporting, or used in a Condition statement in an IAM policy.

Parameter vectorSearchConfiguration : Specifies the number of dimensions for vector embeddings that will be loaded into the graph. The value is specified as dimension=value. Max = 65,535

Implementation

Future<CreateGraphOutput> createGraph({
  required String graphName,
  required int provisionedMemory,
  bool? deletionProtection,
  String? kmsKeyIdentifier,
  bool? publicConnectivity,
  int? replicaCount,
  Map<String, String>? tags,
  VectorSearchConfiguration? vectorSearchConfiguration,
}) async {
  _s.validateNumRange(
    'provisionedMemory',
    provisionedMemory,
    16,
    24576,
    isRequired: true,
  );
  _s.validateNumRange(
    'replicaCount',
    replicaCount,
    0,
    2,
  );
  final $payload = <String, dynamic>{
    'graphName': graphName,
    'provisionedMemory': provisionedMemory,
    if (deletionProtection != null) 'deletionProtection': deletionProtection,
    if (kmsKeyIdentifier != null) 'kmsKeyIdentifier': kmsKeyIdentifier,
    if (publicConnectivity != null) 'publicConnectivity': publicConnectivity,
    if (replicaCount != null) 'replicaCount': replicaCount,
    if (tags != null) 'tags': tags,
    if (vectorSearchConfiguration != null)
      'vectorSearchConfiguration': vectorSearchConfiguration,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/graphs',
    exceptionFnMap: _exceptionFns,
  );
  return CreateGraphOutput.fromJson(response);
}