

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# 連絡先と連絡先のバージョニングを更新する
<a name="contacts.versioning"></a>

 AWS Ground Station では、、`SCHEDULED`、`PREPASS`または の問い合わせステータスで`PASS`問い合わせを更新できます。 [AWS Ground Station 問い合わせステータス](contacts.lifecycle.md#contact-statuses)[UpdateContact](https://docs.aws.amazon.com/ground-station/latest/APIReference/API_UpdateContact.html) API を使用して、アジマス/標高、OEM、TLE 追跡データなど、問い合わせのエフェメリスオーバーライドを指定でき、キャンセルやスケジュール変更は不要です。これは、コンタクト中にアンテナを別の衛星に再タスクする必要があるジオ同期 (GEO) 衛星操作や、ポイント調整が必要な起動および早期操作 (LEOPs) に役立ちます。

 問い合わせを予約または更新するたびに、 は新しい問い合わせバージョン AWS Ground Station を作成します。問い合わせバージョンは、問い合わせに加えられた変更の履歴を提供し、各更新のステータスを追跡できます。

## 問い合わせのバージョニングの仕組み
<a name="contacts.versioning.how-it-works"></a>

 [ReserveContact](https://docs.aws.amazon.com/ground-station/latest/APIReference/API_ReserveContact.html) を呼び出すと、 は問い合わせの最初のバージョン (バージョン 1) AWS Ground Station を作成し、レスポンス`versionId`で を返します。[UpdateContact](https://docs.aws.amazon.com/ground-station/latest/APIReference/API_UpdateContact.html) を後から呼び出すたびに、バージョン番号が増分された新しいバージョンが作成されます。

 [DescribeContact](https://docs.aws.amazon.com/ground-station/latest/APIReference/API_DescribeContact.html) API は、レスポンスの `version`フィールドのバージョン情報を含む、現在の`ACTIVE`[問い合わせ](#contacts.versioning.version-statuses)バージョンを返します。[ListContacts](https://docs.aws.amazon.com/ground-station/latest/APIReference/API_ListContacts.html) API には、各問い合わせのバージョン情報も含まれています。

 特定のバージョンの問い合わせを表示するには、[DescribeContactVersion](https://docs.aws.amazon.com/ground-station/latest/APIReference/API_DescribeContactVersion.html) API を使用します。連絡先のすべてのバージョンを一覧表示するには、[ListContactVersions](https://docs.aws.amazon.com/ground-station/latest/APIReference/API_ListContactVersions.html) API を使用します。

## 連絡先の更新
<a name="contacts.versioning.update-contact"></a>

 コンタクトが SCHEDULED、PREPASS、または PASS 状態のときに [UpdateContact](https://docs.aws.amazon.com/ground-station/latest/APIReference/API_UpdateContact.html) を呼び出すことができます。 API は、次のパラメータを受け入れます。
+ **contactId** — 更新する問い合わせの識別子。
+ **clientToken** — リクエストが 1 回だけ処理されるようにするべき等性トークン。同じクライアントトークンを使用してリクエストを再試行すると、 は更新を再度実行せずに元のレスポンス AWS Ground Station を返します。 AWS SDKsは、クライアントトークンが指定されていない場合、自動的にクライアントトークンを生成します。
+ **trackingOverrides** — 問い合わせの新しい追跡設定。これには、プログラムトラック設定 (調整/昇格、TLE、または OEM エフェメリス) が含まれます。
+ **satelliteArn** — コンタクトの衛星の ARN。ターゲット衛星をプログラムトラック設定とともに変更する場合は、新しい衛星の ARN を指定します。この値を null に設定できるのは、方位角/高さのポイント角度に対して承認されたお客様のみです。他のすべてのお客様は、問い合わせの衛星 ARN を含める必要があります。

**重要**  
 `UpdateContact` API は、リクエスト内のすべてのパラメータを適用します。省略または明示的に null に設定されたパラメータは、その値を変更せずにクリアするリクエストとして扱われます。たとえば、 を指定`trackingOverrides`しても を省略すると`satelliteArn`、衛星 ARN はクリアされます。各更新リクエストに必要な値をすべて含めてください。

 コンタクト中にターゲット衛星を変更するには、対応する `satelliteArn`とともに新しい を指定します`trackingOverrides`。コンタクトの開始時刻と終了時刻はこの API では変更されないため、コンタクト中は新しい衛星を地上局から表示する必要があります。新しい衛星も地上局にオンボードされ、ミッションプロファイルに必要なライセンスを持っている必要があります。コンタクトのミッションプロファイルは変更できないため、両方の衛星が同じミッションプロファイルを使用する場合にのみ、衛星の切り替えが適用されます。

**重要**  
 `UpdateContact` API は、問い合わせの開始時刻、終了時刻、またはミッションプロファイルの変更をサポートしていません。これらの値を変更するには、問い合わせをキャンセルし、新しい問い合わせを予約します。`UpdateContact` API は、衛星間の切り替えやエフェメリスデータの更新など、アンテナポイント設定を再マスキングするように設計されています。

**重要**  
 `UpdateContact` API は、 [アンテナダウンリンク復調デコード設定](how-it-works.config.md#how-it-works.config-antenna-downlink-demod-decode)設定を使用するミッションプロファイルを持つ連絡先をサポートしていません。これらの問い合わせの設定を変更するには、問い合わせをキャンセルし、新しい問い合わせを予約します。

 `UpdateContact` API は、 `contactId`と新しい を返します`versionId`。更新は非同期的に処理されます。[DescribeContactVersion](https://docs.aws.amazon.com/ground-station/latest/APIReference/API_DescribeContactVersion.html) を使用して、更新のステータスを確認します。 AWS SDKsと は、バージョンが ACTIVE または FAILED\_TO\_UPDATE ステータスになるまでポーリングする`ContactUpdated`ウェーター AWS Command Line Interface を提供します。

**注記**  
 一度に実行できる更新は 1 つだけです。最新の問い合わせバージョンが UPDATING 状態の場合、API は を返します`ConflictException`。現在の更新が ACTIVE または FAILED\_TO\_UPDATE ステータスになるまで待ってから、別の更新を送信します。

## 問い合わせバージョンのステータス
<a name="contacts.versioning.version-statuses"></a>

各問い合わせバージョンには、次のいずれかのステータスがあります。


| ステータス | 説明 | 
| --- | --- | 
| [UPDATING] (更新中) | バージョンが問い合わせに適用されています。更新が送信され、 によって処理されています AWS Ground Station。 | 
| アクティブ | バージョンは、問い合わせの現在アクティブな設定です。地上局はこのバージョンの設定を使用しています。 | 
| 置き換え済み | バージョンは以前はアクティブでしたが、新しいバージョンに置き換えられました。 | 
| FAILED\_TO\_UPDATE | 更新を適用できませんでした。問い合わせは、以前にアクティブだったバージョンに戻ります。詳細については、 フィールドfailureCodesと failureMessageフィールドを確認してください。 | 

## コードの例
<a name="contacts.versioning.examples"></a>

 次の例は、 AWS SDK for Python (Boto3) で問い合わせバージョニング APIs を使用する方法を示しています。

### 例: 連絡先を更新する
<a name="contacts.versioning.examples.update-contact"></a>

 次の例では、新しい追跡オーバーライドで連絡先を更新し、Boto3 `ContactUpdated`ウェーターを使用して更新が完了するまで待機します。

```
import boto3
import uuid

# Create AWS Ground Station client
ground_station_client = boto3.client("groundstation")

# The contact ID of an existing scheduled contact to update
contact_id = "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"

# Generate a unique client token for idempotency.
# If you retry the same request with the same client token,
# the API returns the same response without creating a duplicate version.
client_token = str(uuid.uuid4())

# Update the contact to use a different TLE ephemeris for tracking.
# The UpdateContact API applies all parameters in the request.
# Any parameter set to null is treated as a request to clear that value,
# not to leave it unchanged. Include all desired values in each request.
print(f"Updating contact {contact_id}...")

update_response = ground_station_client.update_contact(
    contactId=contact_id,
    clientToken=client_token,
    satelliteArn="arn:aws:groundstation::111122223333:satellite/a88611b0-f755-404e-b60d-57d8aEXAMPLE",
    trackingOverrides={
        "programTrackSettings": {
            "tle": {"ephemerisId": "b2c3d4e5-6789-01ab-cdef-EXAMPLE22222"}
        }
    },
)

contact_id = update_response["contactId"]
version_id = update_response["versionId"]
print(f"Update submitted. Contact: {contact_id}, Version: {version_id}")

# Wait for the update to complete using the ContactUpdated waiter.
# The waiter polls DescribeContactVersion until the version reaches
# ACTIVE (success) or FAILED_TO_UPDATE (failure) status.
# The waiter raises WaiterError if the version reaches FAILED_TO_UPDATE
# or if MaxAttempts is exceeded, so we use try/except to handle both cases.
print("Waiting for update to complete...")

from botocore.exceptions import WaiterError

waiter = ground_station_client.get_waiter("contact_updated")

try:
    waiter.wait(
        contactId=contact_id,
        versionId=version_id,
        WaiterConfig={
            "Delay": 5,
            "MaxAttempts": 180,
        },
    )
    print(f"Contact updated successfully. Version {version_id} is now active.")
except WaiterError as e:
    # WaiterError is raised when the version reaches FAILED_TO_UPDATE
    # or when MaxAttempts is exceeded. Retrieve the current version to inspect.
    version_response = ground_station_client.describe_contact_version(
        contactId=contact_id,
        versionId=version_id,
    )
    version_status = version_response["version"]["status"]
    if version_status == "FAILED_TO_UPDATE":
        failure_codes = version_response["version"].get("failureCodes", [])
        failure_message = version_response["version"].get("failureMessage", "")
        print(f"Update failed. Codes: {failure_codes}, Message: {failure_message}")
    else:
        print(f"Waiter timed out. Current version status: {version_status}. Error: {e}")
```

### 例: 問い合わせバージョンを記述する
<a name="contacts.versioning.examples.describe-contact-version"></a>

 次の の例では、ステータス、設定、障害情報など、特定の問い合わせバージョンの詳細を取得します。

```
import boto3

# Create AWS Ground Station client
ground_station_client = boto3.client("groundstation")

contact_id = "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
version_id = 2

# Describe a specific version of a contact.
# Use this API to check the status of an update or to view the
# configuration that was active at a specific point in time.
print(f"Describing version {version_id} of contact {contact_id}...")

response = ground_station_client.describe_contact_version(
    contactId=contact_id,
    versionId=version_id,
)

# Display version details
version = response["version"]
print(f"Version ID: {version['versionId']}")
print(f"Status: {version['status']}")
print(f"Created: {version.get('created', 'N/A')}")

if version.get("activated"):
    print(f"Activated: {version['activated']}")

if version.get("superseded"):
    print(f"Superseded: {version['superseded']}")

# Display contact details for this version
print(f"\nContact ID: {response['contactId']}")
print(f"Contact Status: {response['contactStatus']}")
print(f"Ground Station: {response['groundStation']}")
print(f"Start Time: {response['startTime']}")
print(f"End Time: {response['endTime']}")

if response.get("satelliteArn"):
    print(f"Satellite ARN: {response['satelliteArn']}")

if response.get("trackingOverrides"):
    print(f"Tracking Overrides: {response['trackingOverrides']}")

# Check for failure details if the version failed to update
if version["status"] == "FAILED_TO_UPDATE":
    failure_codes = version.get("failureCodes", [])
    failure_message = version.get("failureMessage", "")
    print(f"\nFailure Codes: {failure_codes}")
    print(f"Failure Message: {failure_message}")
```

### 例: 問い合わせバージョンを一覧表示する
<a name="contacts.versioning.examples.list-contact-versions"></a>

 次の の例では、大きな結果セットを処理するためにページ分割を使用して、変更の完全な履歴を表示する問い合わせのすべてのバージョンを一覧表示します。

```
import boto3

# Create AWS Ground Station client
ground_station_client = boto3.client("groundstation")

contact_id = "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"

# List all versions of a contact to view the full history of changes.
# Results are paginated. Use the nextToken to retrieve additional pages.
print(f"Listing versions for contact {contact_id}...")

paginator = ground_station_client.get_paginator("list_contact_versions")
page_iterator = paginator.paginate(
    contactId=contact_id,
    PaginationConfig={
        "MaxItems": 100,
        "PageSize": 20,
    },
)

for page in page_iterator:
    for version in page["contactVersionsList"]:
        version_id = version["versionId"]
        status = version["status"]
        created = version.get("created", "N/A")

        print(f"  Version {version_id}: status={status}, created={created}")

        if version.get("activated"):
            print(f"    Activated: {version['activated']}")

        if version.get("superseded"):
            print(f"    Superseded: {version['superseded']}")

        if status == "FAILED_TO_UPDATE":
            failure_codes = version.get("failureCodes", [])
            failure_message = version.get("failureMessage", "")
            print(f"    Failure Codes: {failure_codes}")
            print(f"    Failure Message: {failure_message}")

        if status == "UPDATING":
            print(f"    Update is currently in progress.")
```

## 考慮事項
<a name="contacts.versioning.considerations"></a>
+  問い合わせのバージョニング機能が導入される前に作成された問い合わせには、バージョン情報がありません。これらの問い合わせに対して [DescribeContactVersion](https://docs.aws.amazon.com/ground-station/latest/APIReference/API_DescribeContactVersion.html) または [ListContactVersions](https://docs.aws.amazon.com/ground-station/latest/APIReference/API_ListContactVersions.html) を呼び出すと、 が返されます`ResourceNotFoundException`。
+  進行中のコンタクトの追跡オーバーライドを更新すると、アンテナが新しいポイント設定に調整される間、短い移行期間があります。この間、シグナルの受信または送信が中断される可能性があります。
+  問い合わせバージョンは削除できません。[ListContactVersions](https://docs.aws.amazon.com/ground-station/latest/APIReference/API_ListContactVersions.html) を使用して、連絡先に加えられた変更の完全な履歴を表示します。
+  `UpdateContact` API は、問い合わせのスケジュールリージョンからのみ呼び出すことができます。