

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

# 地上局の予約を表示する
<a name="locations.reservations"></a>

 [ListGroundStationReservations](https://docs.aws.amazon.com/ground-station/latest/APIReference/API_ListGroundStationReservations.html) API を使用して、地上局のアンテナ全体の予約を表示できます。予約は、スケジュールされたコンタクトを含むアンテナのタイムブロックを表します。 の[AWS Ground Station 専用アンテナ](dedicated-antennas.md)お客様にはメンテナンスウィンドウも表示されます。

 この情報は、コンタクトスケジュールを計画する際のアンテナの可用性を理解し、地上局のアンテナで何が起こっているのかを可視化するのに役立ちます。

## 予約の一覧表示
<a name="locations.reservations.listing"></a>

 予約を一覧表示するには、地上局識別子と時間範囲を使用して [ListGroundStationReservations](https://docs.aws.amazon.com/ground-station/latest/APIReference/API_ListGroundStationReservations.html) を呼び出します。API は、指定された時間枠内に地上ステーションのすべてのアンテナの予約を返します。

 表示される予約は、アクセスレベルによって異なります。
+  **一般 AWS Ground Station のお客様** — 自分の問い合わせ予約のみを表示できます。メンテナンスウィンドウと他のアカウントが所有する連絡先は含まれません。
+  **AWS Ground Station Dedicated Antennas のお客様** — 他のアカウントによってスケジュールされたメンテナンスウィンドウや連絡先など、Dedicated Antennas のすべての予約を表示できます。問い合わせ識別子は、所有している問い合わせにのみ含まれます。詳細については、「[AWS Ground Station 専用アンテナ](dedicated-antennas.md)」を参照してください。

## 予約タイプ
<a name="locations.reservations.types"></a>

各予約には、アンテナ時間が何に使用されているかを示すタイプがあります。
+  **コンタクト** — コンタクト予約は、衛星通信用に予約されたアンテナ時間を表します。予約の開始時刻と終了時刻には、衛星パスウィンドウだけでなく、パス前時刻とパス後時刻を含むアンテナ予約全体が反映されます。
+  **メンテナンス** — メンテナンス予約は、メンテナンスのためにアンテナが使用できない期間を表します。メンテナンス予約には、メンテナンス`maintenanceType`が計画されたかどうかを示す が含まれます。

## コード例
<a name="locations.reservations.examples"></a>

 次の の例では、予約タイプによるフィルタリングを含め、 AWS SDK for Python (Boto3) を使用して、今後 7 日間の地上局の予約を一覧表示します。

```
import boto3
from datetime import datetime, timezone, timedelta

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

# The ground station ID to list reservations for
ground_station_id = "Ohio 1"

# Define the time range to query. Reservations include both your
# scheduled contacts and maintenance windows at the ground station.
start_time = datetime.now(timezone.utc)
end_time = start_time + timedelta(days=7)

# List all reservations at a ground station for the next 7 days.
# You can filter by reservation type to see only contacts or
# only maintenance windows.
print(f"Listing reservations for ground station '{ground_station_id}'...")
print(f"Time range: {start_time} to {end_time}")

paginator = ground_station_client.get_paginator("list_ground_station_reservations")
page_iterator = paginator.paginate(
    groundStationId=ground_station_id,
    startTime=start_time,
    endTime=end_time,
    PaginationConfig={
        "MaxItems": 100,
        "PageSize": 20,
    },
)

for page in page_iterator:
    for reservation in page["reservationList"]:
        reservation_type = reservation["reservationType"]
        antenna_name = reservation["antennaName"]
        res_start = reservation["startTime"]
        res_end = reservation["endTime"]

        print(f"  Type: {reservation_type}")
        print(f"    Antenna: {antenna_name}")
        print(f"    Start: {res_start}")
        print(f"    End: {res_end}")

        details = reservation["reservationDetails"]
        if "contact" in details:
            contact_id = details["contact"].get("contactId", "N/A")
            print(f"    Contact ID: {contact_id}")
        elif "maintenance" in details:
            maintenance_type = details["maintenance"]["maintenanceType"]
            print(f"    Maintenance Type: {maintenance_type}")

        print()

# For Dedicated Antenna customers, you can also filter to show only maintenance windows
print("Listing only maintenance reservations...")

page_iterator = paginator.paginate(
    groundStationId=ground_station_id,
    startTime=start_time,
    endTime=end_time,
    reservationTypes=["MAINTENANCE"],
    PaginationConfig={
        "MaxItems": 100,
        "PageSize": 20,
    },
)

for page in page_iterator:
    for reservation in page["reservationList"]:
        maintenance_type = reservation["reservationDetails"]["maintenance"][
            "maintenanceType"
        ]
        print(
            f"  {maintenance_type} maintenance on {reservation['antennaName']}: "
            f"{reservation['startTime']} to {reservation['endTime']}"
        )
```