Skip to content

create_graph

create_graph(
    graph_name: GraphName,
    provisioned_memory: ProvisionedMemory,
    *,
    config_overrides: Optional[NeptuneGraphClientConfig] = None,
    tags: Optional[TagMap] = None,
    public_connectivity: Optional[bool] = None,
    kms_key_identifier: Optional[KmsKeyArn] = None,
    vector_search_configuration: Optional[VectorSearchConfiguration] = None,
    replica_count: Optional[ReplicaCount] = None,
    deletion_protection: Optional[bool] = None,
) -> CreateGraphOutput

Creates a new Neptune Analytics graph.

Parameters:

  • graph_name (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.

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

    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.

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

  • kms_key_identifier (Optional[KmsKeyArn], default: None ) –

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

  • vector_search_configuration (Optional[VectorSearchConfiguration], default: None ) –

    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

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

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

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

  • provisioned_memory (ProvisionedMemory) –

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

Raises:

Source code in docs_src/capo_neptune_graph/_services/neptune_graph.py
def create_graph(
    self,
    graph_name: "capo_neptune_graph.types.graph_name.GraphName",
    provisioned_memory: "capo_neptune_graph.types.provisioned_memory.ProvisionedMemory",
    *,
    config_overrides: Optional[NeptuneGraphClientConfig] = None,
    tags: Optional["capo_neptune_graph.types.tag_map.TagMap"] = None,
    public_connectivity: Optional[bool] = None,
    kms_key_identifier: Optional[
        "capo_neptune_graph.types.kms_key_arn.KmsKeyArn"
    ] = None,
    vector_search_configuration: Optional[
        "capo_neptune_graph.types.vector_search_configuration.VectorSearchConfiguration"
    ] = None,
    replica_count: Optional[
        "capo_neptune_graph.types.replica_count.ReplicaCount"
    ] = None,
    deletion_protection: Optional[bool] = None,
) -> "capo_neptune_graph.types.create_graph_output.CreateGraphOutput":
    """<p>Creates a new Neptune Analytics graph.</p>

    Args:
        graph_name: <p>A name for the new Neptune Analytics graph to be created.</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>
        tags: <p>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.</p>
        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>
        kms_key_identifier: <p>Specifies a KMS key to use to encrypt data in the new graph.</p>
        vector_search_configuration: <p>Specifies the number of dimensions for vector embeddings that will be loaded into the graph. The value is specified as <code>dimension=</code>value. Max = 65,535</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>
        deletion_protection: <p>Indicates whether or not to enable deletion protection on the graph. The graph can’t be deleted when deletion protection is enabled. (<code>true</code> or <code>false</code>).</p>
        provisioned_memory: <p>The provisioned memory-optimized Neptune Capacity Units (m-NCUs) to use for the graph. Min = 16</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.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.
    """

    def _handler(
        req: "OperationRequest[capo_neptune_graph.types.create_graph_input.CreateGraphInput]",
    ) -> OperationResponse[
        "capo_neptune_graph.types.create_graph_output.CreateGraphOutput"
    ]:
        import capo_neptune_graph._operations.amazon_neptune_graph.create_graph

        output, http_response = (
            capo_neptune_graph._operations.amazon_neptune_graph.create_graph.create_graph(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateGraph")
    )
    input_: capo_neptune_graph.types.create_graph_input.CreateGraphInput = {
        "graph_name": graph_name,
        "provisioned_memory": provisioned_memory,
    }
    if tags is not None:
        input_["tags"] = tags
    if public_connectivity is not None:
        input_["public_connectivity"] = public_connectivity
    if kms_key_identifier is not None:
        input_["kms_key_identifier"] = kms_key_identifier
    if vector_search_configuration is not None:
        input_["vector_search_configuration"] = vector_search_configuration
    if replica_count is not None:
        input_["replica_count"] = replica_count
    if deletion_protection is not None:
        input_["deletion_protection"] = deletion_protection

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output