

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# Neptune 装载机示例 Get-Status
<a name="load-api-reference-status-examples"></a>

 以下示例展示了 Neptune 加载器的 GET-Status API 的用法，它允许您检索有关加载到 Amazon Neptune 图表数据库中的数据状态的信息。这些示例涵盖了三种主要场景：检索特定加载的状态、列出可用的加载 ID，以及请求特定加载的详细状态信息。

## 加载状态请求示例
<a name="load-api-reference-status-examples-status-request"></a>

下面是使用 `curl` 命令经由 HTTP `GET` 发送的请求。

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

```
aws neptunedata get-loader-job-status \
  --endpoint-url https://{{your-neptune-endpoint}}:{{port}} \
  --load-id {{loadId (a UUID)}}
```

有关更多信息，请参阅《命令参考》中的 [get-loader-job-stat](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/get-loader-job-status.html) us。 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_loader_job_status(
    loadId='{{loadId (a UUID)}}'
)

print(response)
```

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

```
awscurl 'https://{{your-neptune-endpoint}}:{{port}}/loader/{{loadId (a UUID)}}' \
  --region {{us-east-1}} \
  --service neptune-db
```

**注意**  
此示例假设您的 AWS 证书是在您的环境中配置的。{{us-east-1}}替换为 Neptune 集群的区域。

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

```
curl -X GET 'https://{{your-neptune-endpoint}}:{{port}}/loader/{{loadId (a UUID)}}'
```

------

**Example 响应**  

```
{
    "status" : "200 OK",
    "payload" : {
        "feedCount" : [
            {
                "LOAD_FAILED" : 1
            }
        ],
        "overallStatus" : {
            "datatypeMismatchErrors" : 0,
            "fullUri" : "s3://{{bucket}}/{{key}}",
            "insertErrors" : 0,
            "parsingErrors" : 5,
            "retryNumber" : 0,
            "runNumber" : 1,
            "status" : "LOAD_FAILED",
            "totalDuplicates" : 0,
            "totalRecords" : 5,
            "totalTimeSpent" : 3.0
        }
    }
}
```

## loadId 请求示例
<a name="load-api-reference-status-examples-loadId-request"></a>

下面是使用 `curl` 命令经由 HTTP `GET` 发送的请求。

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

```
aws neptunedata list-loader-jobs \
  --endpoint-url https://{{your-neptune-endpoint}}:{{port}} \
  --limit 3
```

有关更多信息，请参阅《命令参考》中的 [list-loader-job](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/list-loader-jobs.html) s。 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.list_loader_jobs(
    limit=3
)

print(response)
```

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

```
awscurl 'https://{{your-neptune-endpoint}}:{{port}}/loader?limit=3' \
  --region {{us-east-1}} \
  --service neptune-db
```

**注意**  
此示例假设您的 AWS 证书是在您的环境中配置的。{{us-east-1}}替换为 Neptune 集群的区域。

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

```
curl -X GET 'https://{{your-neptune-endpoint}}:{{port}}/loader?limit=3'
```

------

**Example 响应**  

```
{
    "status" : "200 OK",
    "payload" : {
         "loadIds" : [
            "a2c0ce44-a44b-4517-8cd4-1dc144a8e5b5",
            "09683a01-6f37-4774-bb1b-5620d87f1931",
            "58085eb8-ceb4-4029-a3dc-3840969826b9"
        ]
    }
}
```

## 详细状态请求示例
<a name="load-api-reference-status-examples-details-request"></a>

下面是使用 `curl` 命令经由 HTTP `GET` 发送的请求。

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

```
aws neptunedata get-loader-job-status \
  --endpoint-url https://{{your-neptune-endpoint}}:{{port}} \
  --load-id {{loadId (a UUID)}} \
  --details
```

有关更多信息，请参阅《命令参考》中的 [get-loader-job-stat](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/get-loader-job-status.html) us。 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_loader_job_status(
    loadId='{{loadId (a UUID)}}',
    details=True
)

print(response)
```

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

```
awscurl 'https://{{your-neptune-endpoint}}:{{port}}/loader/{{loadId (a UUID)}}?details=true' \
  --region {{us-east-1}} \
  --service neptune-db
```

**注意**  
此示例假设您的 AWS 证书是在您的环境中配置的。{{us-east-1}}替换为 Neptune 集群的区域。

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

```
curl -X GET 'https://{{your-neptune-endpoint}}:{{port}}/loader/{{loadId (a UUID)}}?details=true'
```

------

**Example 响应**  

```
{
    "status" : "200 OK",
    "payload" : {
        "failedFeeds" : [
            {
                "datatypeMismatchErrors" : 0,
                "fullUri" : "s3://{{bucket}}/{{key}}",
                "insertErrors" : 0,
                "parsingErrors" : 5,
                "retryNumber" : 0,
                "runNumber" : 1,
                "status" : "LOAD_FAILED",
                "totalDuplicates" : 0,
                "totalRecords" : 5,
                "totalTimeSpent" : 3.0
            }
        ],
        "feedCount" : [
            {
                "LOAD_FAILED" : 1
            }
        ],
        "overallStatus" : {
            "datatypeMismatchErrors" : 0,
            "fullUri" : "s3://{{bucket}}/{{key}}",
            "insertErrors" : 0,
            "parsingErrors" : 5,
            "retryNumber" : 0,
            "runNumber" : 1,
            "status" : "LOAD_FAILED",
            "totalDuplicates" : 0,
            "totalRecords" : 5,
            "totalTimeSpent" : 3.0
        }
    }
}
```