

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

# Servlet status Neptunus OpenCypher dan titik akhir status
<a name="access-graph-opencypher-status"></a>

Titik akhir status OpenCypher menyediakan akses ke informasi tentang kueri yang saat ini berjalan di server atau menunggu untuk dijalankan. Ini juga memungkinkan Anda membatalkan kueri tersebut. Titik akhir adalah:

```
https://{{(the server)}}:{{(the port number)}}/openCypher/status
```

Anda dapat menggunakan HTTP `GET` dan `POST` metode untuk mendapatkan status saat ini dari server, atau untuk membatalkan kueri. Anda juga dapat menggunakan `DELETE` metode ini untuk membatalkan kueri yang sedang berjalan atau menunggu.

## Parameter untuk permintaan status
<a name="access-graph-opencypher-status-parameters"></a>

**Parameter kueri status**
+ **`includeWaiting`**(`true`atau`false`) — Ketika diset `true` el ke dan parameter lainnya tidak ada, menyebabkan informasi status untuk kueri menunggu dikembalikan serta untuk menjalankan kueri.
+ **`cancelQuery`**— Hanya digunakan dengan `POST` metode `GET` dan, untuk menunjukkan bahwa ini adalah permintaan pembatalan. `DELETE`Metode ini tidak memerlukan parameter ini.

  Nilai `cancelQuery` parameter tidak digunakan, tetapi ketika `cancelQuery` ada, `queryId` parameter diperlukan, untuk mengidentifikasi kueri mana yang akan dibatalkan.
+ **`queryId`**— Berisi ID kueri tertentu.

  Ketika digunakan dengan `POST` metode `GET` or dan `cancelQuery` parameter tidak ada, `queryId` menyebabkan informasi status dikembalikan untuk kueri spesifik yang diidentifikasi. Jika `cancelQuery` parameter ada, maka kueri spesifik yang `queryId` mengidentifikasi dibatalkan.

  Saat digunakan dengan `DELETE` metode ini, `queryId` selalu menunjukkan kueri tertentu yang akan dibatalkan.
+ **`silent`**— Hanya digunakan saat membatalkan kueri. Jika disetel ke`true`, menyebabkan pembatalan terjadi secara diam-diam.

## Bidang respons permintaan status
<a name="access-graph-opencypher-status-response-fields"></a>

**Bidang respons status jika ID kueri tertentu tidak disediakan**
+ **diterima QueryCount ** — Jumlah kueri yang telah diterima tetapi belum selesai, termasuk kueri dalam antrian.
+ **running QueryCount ** — Jumlah kueri OpenCypher yang sedang berjalan.
+ **query ** — Daftar kueri OpenCypher saat ini.

**Bidang respons status untuk kueri tertentu**
+ **queryId** — id GUID untuk kueri. Neptune secara otomatis memberikan nilai ID ini ke setiap kueri, atau Anda juga dapat menetapkan ID Anda sendiri (lihat [Menyuntikkan ID Kustom Ke Dalam Gremlin Neptune atau Kueri SPARQL](features-query-id.md)).
+ **queryString** — Query yang dikirimkan. Ini dipotong menjadi 1024 karakter jika lebih panjang dari itu.
+ **query EvalStats ** - Statistik untuk kueri ini:
  + ****— Menunjukkan berapa lama kueri menunggu, dalam milidetik.
  + **elapsed** — Jumlah milidetik kueri telah berjalan sejauh ini.
  + **dibatalkan ** — `True` menunjukkan bahwa kueri dibatalkan, atau `False` belum dibatalkan.

## Contoh permintaan status dan tanggapan
<a name="access-graph-opencypher-status-samples"></a>
+ **Meminta status semua kueri, termasuk yang menunggu: **

------
#### [ AWS CLI ]

  ```
  aws neptunedata get-open-cypher-query-status \
    --endpoint-url https://{{your-neptune-endpoint}}:{{port}} \
    --include-waiting
  ```

  Untuk informasi selengkapnya, lihat [ get-open-cypher- ](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/get-open-cypher-query-status.html) query-status di Referensi Perintah. AWS CLI 

------
#### [ SDK ]

  ```
  import boto3
  from botocore.config import Config
  
  client = boto3.client(
      'neptunedata',
      endpoint_url='https://{{your-neptune-endpoint}}:{{port}}',
      config=Config(read_timeout=None, retries={'total_max_attempts': 1})
  )
  
  response = client.get_open_cypher_query_status(
      includeWaiting=True
  )
  
  print(response)
  ```

  Untuk contoh AWS SDK dalam bahasa lain, lihat[AWS SDK](access-graph-opencypher-sdk.md).

------
#### [ awscurl ]

  ```
  awscurl https://{{your-neptune-endpoint}}:{{port}}/openCypher/status \
    --region {{us-east-1}} \
    --service neptune-db \
    -X POST \
    -d "includeWaiting=true"
  ```

**catatan**  
Contoh ini mengasumsikan bahwa AWS kredenSIAL Anda dikonfigurasi di lingkungan Anda. Ganti {{us-east-1}} dengan Wilayah cluster Neptunus Anda.

------
#### [ curl ]

  ```
  curl https://{{your-neptune-endpoint}}:{{port}}/openCypher/status \
    --data-urlencode "includeWaiting=true"
  ```

------

  *Tanggapan: *

  ```
  {
    "acceptedQueryCount" : 0,
    "runningQueryCount" : 0,
    "queries" : [ ]
  }
  ```
+ **Permintaan status kueri yang sedang berjalan, ** tidak ** termasuk yang menunggu:**:

------
#### [ AWS CLI ]

  ```
  aws neptunedata get-open-cypher-query-status \
    --endpoint-url https://{{your-neptune-endpoint}}:{{port}}
  ```

  Untuk informasi selengkapnya, lihat [ get-open-cypher- ](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/get-open-cypher-query-status.html) query-status di Referensi Perintah. AWS CLI 

------
#### [ SDK ]

  ```
  import boto3
  from botocore.config import Config
  
  client = boto3.client(
      'neptunedata',
      endpoint_url='https://{{your-neptune-endpoint}}:{{port}}',
      config=Config(read_timeout=None, retries={'total_max_attempts': 1})
  )
  
  response = client.get_open_cypher_query_status()
  
  print(response)
  ```

  Untuk contoh AWS SDK dalam bahasa lain, lihat[AWS SDK](access-graph-opencypher-sdk.md).

------
#### [ awscurl ]

  ```
  awscurl https://{{your-neptune-endpoint}}:{{port}}/openCypher/status \
    --region {{us-east-1}} \
    --service neptune-db
  ```

**catatan**  
Contoh ini mengasumsikan bahwa AWS kredenSIAL Anda dikonfigurasi di lingkungan Anda. Ganti {{us-east-1}} dengan Wilayah cluster Neptunus Anda.

------
#### [ curl ]

  ```
  curl https://{{your-neptune-endpoint}}:{{port}}/openCypher/status
  ```

------

  *Tanggapan: *

  ```
  {
    "acceptedQueryCount" : 0,
    "runningQueryCount" : 0,
    "queries" : [ ]
  }
  ```
+ **Permintaan status kueri tunggal: **

------
#### [ AWS CLI ]

  ```
  aws neptunedata get-open-cypher-query-status \
    --endpoint-url https://{{your-neptune-endpoint}}:{{port}} \
    --query-id {{eadc6eea-698b-4a2f-8554-5270ab17ebee}}
  ```

  Untuk informasi selengkapnya, lihat [ get-open-cypher- ](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/get-open-cypher-query-status.html) query-status di Referensi Perintah. AWS CLI 

------
#### [ SDK ]

  ```
  import boto3
  from botocore.config import Config
  
  client = boto3.client(
      'neptunedata',
      endpoint_url='https://{{your-neptune-endpoint}}:{{port}}',
      config=Config(read_timeout=None, retries={'total_max_attempts': 1})
  )
  
  response = client.get_open_cypher_query_status(
      queryId='{{eadc6eea-698b-4a2f-8554-5270ab17ebee}}'
  )
  
  print(response)
  ```

  Untuk contoh AWS SDK dalam bahasa lain, lihat[AWS SDK](access-graph-opencypher-sdk.md).

------
#### [ awscurl ]

  ```
  awscurl https://{{your-neptune-endpoint}}:{{port}}/openCypher/status \
    --region {{us-east-1}} \
    --service neptune-db \
    -X POST \
    -d "queryId={{eadc6eea-698b-4a2f-8554-5270ab17ebee}}"
  ```

**catatan**  
Contoh ini mengasumsikan bahwa AWS kredenSIAL Anda dikonfigurasi di lingkungan Anda. Ganti {{us-east-1}} dengan Wilayah cluster Neptunus Anda.

------
#### [ curl ]

  ```
  curl https://{{your-neptune-endpoint}}:{{port}}/openCypher/status \
    --data-urlencode "queryId={{eadc6eea-698b-4a2f-8554-5270ab17ebee}}"
  ```

------

  *Tanggapan: *

  ```
  {
    "queryId" : "eadc6eea-698b-4a2f-8554-5270ab17ebee",
    "queryString" : "MATCH (n1)-[:knows]->(n2), (n2)-[:knows]->(n3), (n3)-[:knows]->(n4), (n4)-[:knows]->(n5), (n5)-[:knows]->(n6), (n6)-[:knows]->(n7), (n7)-[:knows]->(n8), (n8)-[:knows]->(n9), (n9)-[:knows]->(n10) RETURN COUNT(n1);",
    "queryEvalStats" : {
      "waited" : 0,
      "elapsed" : 23463,
      "cancelled" : false
    }
  }
  ```
+ **Permintaan untuk membatalkan kueri **

------
#### [ AWS CLI ]

  ```
  aws neptunedata cancel-open-cypher-query \
    --endpoint-url https://{{your-neptune-endpoint}}:{{port}} \
    --query-id {{f43ce17b-db01-4d37-a074-c76d1c26d7a9}}
  ```

  Untuk informasi selengkapnya, lihat [ cancel-open-cypher- ](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/cancel-open-cypher-query.html) query di Referensi Perintah. AWS CLI 

------
#### [ SDK ]

  ```
  import boto3
  from botocore.config import Config
  
  client = boto3.client(
      'neptunedata',
      endpoint_url='https://{{your-neptune-endpoint}}:{{port}}',
      config=Config(read_timeout=None, retries={'total_max_attempts': 1})
  )
  
  response = client.cancel_open_cypher_query(
      queryId='{{f43ce17b-db01-4d37-a074-c76d1c26d7a9}}'
  )
  
  print(response)
  ```

  Untuk contoh AWS SDK dalam bahasa lain, lihat[AWS SDK](access-graph-opencypher-sdk.md).

------
#### [ awscurl ]

  ```
  awscurl https://{{your-neptune-endpoint}}:{{port}}/openCypher/status \
    --region {{us-east-1}} \
    --service neptune-db \
    -X POST \
    -d "cancelQuery" \
    -d "queryId={{f43ce17b-db01-4d37-a074-c76d1c26d7a9}}"
  ```

**catatan**  
Contoh ini mengasumsikan bahwa AWS kredenSIAL Anda dikonfigurasi di lingkungan Anda. Ganti {{us-east-1}} dengan Wilayah cluster Neptunus Anda.

------
#### [ curl ]

  1. Menggunakan`POST` :

  ```
  curl -X POST https://{{your-neptune-endpoint}}:{{port}}/openCypher/status \
    --data-urlencode "cancelQuery" \
    --data-urlencode "queryId={{f43ce17b-db01-4d37-a074-c76d1c26d7a9}}"
  ```

  2. Menggunakan`GET` :

  ```
  curl -X GET https://{{your-neptune-endpoint}}:{{port}}/openCypher/status \
    --data-urlencode "cancelQuery" \
    --data-urlencode "queryId={{588af350-cfde-4222-bee6-b9cedc87180d}}"
  ```

  3. Menggunakan`DELETE` :

  ```
  curl -X DELETE \
    "https://{{your-neptune-endpoint}}:{{port}}/openCypher/status?queryId={{b9a516d1-d25c-4301-bb80-10b2743ecf0e}}"
  ```

------

  *Tanggapan: *

  ```
  {
    "status" : "200 OK",
    "payload" : true
  }
  ```