|
| 1 | +--- |
| 2 | +title: Azure Resource Graph Sample Queries for Azure Orbital Ground Station |
| 3 | +description: Provides a collection of Azure Resource Graph sample queries for Azure Orbital Ground Station. |
| 4 | +author: kellydevens |
| 5 | +ms.service: orbital |
| 6 | +ms.topic: how-to |
| 7 | +ms.custom: ga |
| 8 | +ms.date: 09/08/2023 |
| 9 | +ms.author: kellydevens |
| 10 | +--- |
| 11 | + |
| 12 | +# Azure Resource Graph sample queries for Azure Orbital Ground Station |
| 13 | + |
| 14 | +This page is a collection of [Azure Resource Graph](../governance/resource-graph/overview.md) |
| 15 | +sample queries for Azure Orbital Ground Station. For a complete list of Azure Resource Graph samples, see |
| 16 | +[Resource Graph samples by Category](../governance/resource-graph/samples/samples-by-category.md) |
| 17 | +and [Resource Graph samples by Table](../governance/resource-graph/samples/samples-by-table.md). |
| 18 | + |
| 19 | +## Sample queries |
| 20 | + |
| 21 | +### List Upcoming Contacts |
| 22 | +#### Sorted by reservation start time |
| 23 | + |
| 24 | +```kusto |
| 25 | +OrbitalResources |
| 26 | +| where type == 'microsoft.orbital/spacecrafts/contacts' and todatetime(properties.reservationStartTime) >= now() |
| 27 | +| sort by todatetime(properties.reservationStartTime) |
| 28 | +| extend Contact_Profile = tostring(split(properties.contactProfile.id, "/")[-1]) |
| 29 | +| extend Spacecraft = tostring(split(id, "/")[-3]) |
| 30 | +| project Contact = tostring(name), Groundstation = tostring(properties.groundStationName), Spacecraft, Contact |
| 31 | +``` |
| 32 | + |
| 33 | +#### Sorted by ground station |
| 34 | + |
| 35 | +```kusto |
| 36 | +OrbitalResources |
| 37 | +| where type == 'microsoft.orbital/spacecrafts/contacts' and todatetime(properties.reservationStartTime) >= now() |
| 38 | +| sort by tostring(properties.groundStationName) |
| 39 | +| extend Contact_Profile = tostring(split(properties.contactProfile.id, "/")[-1]) |
| 40 | +| extend Spacecraft = tostring(split(id, "/")[-3]) |
| 41 | +| project Contact = tostring(name), Groundstation = tostring(properties.groundStationName), Spacecraft, Contact_Profile, Reservation_Start_Time = todatetime(properties.reservationStartTime), Reservation_End_Time = todatetime(properties.reservationEndTime), Status=properties.status, Provisioning_Status=properties.provisioningState |
| 42 | +``` |
| 43 | + |
| 44 | +#### Sorted by contact profile |
| 45 | + |
| 46 | +```kusto |
| 47 | +OrbitalResources |
| 48 | +| where type == 'microsoft.orbital/spacecrafts/contacts' |
| 49 | +| where todatetime(properties.reservationStartTime) >= now() |
| 50 | +| sort by Contact_Profile |
| 51 | +| extend Contact_Profile = tostring(split(properties.contactProfile.id, "/")[-1]) |
| 52 | +| extend Spacecraft = tostring(split(id, "/")[-3]) |
| 53 | +| project Contact = tostring(name), Groundstation = tostring(properties.groundStationName), Spacecraft, Contact_Profile, Reservation_Start_Time = todatetime(properties.reservationStartTime), Reservation_End_Time = todatetime(properties.reservationEndTime), Status=properties.status, Provisioning_Status=properties.provisioningState |
| 54 | +``` |
| 55 | + |
| 56 | +### List Past ‘x’ days Contacts - sorted by reservation start time |
| 57 | + |
| 58 | +```kusto |
| 59 | +OrbitalResources |
| 60 | +| where type == 'microsoft.orbital/spacecrafts/contacts' and todatetime(properties.reservationStartTime) >= now(-1d) |
| 61 | +| sort by todatetime(properties.reservationStartTime) |
| 62 | +| extend Contact_Profile = tostring(split(properties.contactProfile.id, "/")[-1]) |
| 63 | +| extend Spacecraft = tostring(split(id, "/")[-3]) |
| 64 | +| project Contact = tostring(name), Groundstation = tostring(properties.groundStationName), Spacecraft, Contact_Profile, Reservation_Start_Time = todatetime(properties.reservationStartTime), Reservation_End_Time = todatetime(properties.reservationEndTime), Status=properties.status, Provisioning_Status=properties.provisioningState |
| 65 | +``` |
| 66 | + |
| 67 | +### List Past ‘x’ days Contacts on specified ground station – sorted by reservation start time |
| 68 | + |
| 69 | +This query will help customers track all the past contacts sorted by reservation start time for a specified ground station. |
| 70 | + |
| 71 | +```kusto |
| 72 | +OrbitalResources |
| 73 | +| where type == 'microsoft.orbital/spacecrafts/contacts' and todatetime(properties.reservationStartTime) >= now(-1d) and properties.groundStationName == 'Microsoft_Gavle' |
| 74 | +| sort by todatetime(properties.reservationStartTime) |
| 75 | +| extend Contact_Profile = tostring(split(properties.contactProfile.id, "/")[-1]) |
| 76 | +| extend Spacecraft = tostring(split(id, "/")[-3]) |
| 77 | +| project Contact = tostring(name), Groundstation = tostring(properties.groundStationName), Spacecraft, Contact_Profile, Reservation_Start_Time = todatetime(properties.reservationStartTime), Reservation_End_Time = todatetime(properties.reservationEndTime), Status=properties.status, Provisioning_Status=properties.provisioningState |
| 78 | +``` |
| 79 | + |
| 80 | +### List Past ‘x’ days Contacts on specified contact profile – sorted by reservation start time |
| 81 | + |
| 82 | +This query will help customers track all the past contacts sorted by reservation start time for a specified contact profile. |
| 83 | + |
| 84 | +```kusto |
| 85 | +OrbitalResources |
| 86 | +| where type == 'microsoft.orbital/spacecrafts/contacts' |
| 87 | +| extend Contact_Profile = tostring(split(properties.contactProfile.id, "/")[-1]) |
| 88 | +| where todatetime(properties.reservationStartTime) >= now(-1d) and Contact_Profile == 'test-CP' |
| 89 | +| sort by todatetime(properties.reservationStartTime) |
| 90 | +| extend Spacecraft = tostring(split(id, "/")[-3]) |
| 91 | +| project Contact = tostring(name), Groundstation = tostring(properties.groundStationName), Spacecraft, Contact_Profile, Reservation_Start_Time = todatetime(properties.reservationStartTime), Reservation_End_Time = todatetime(properties.reservationEndTime), Status=properties.status, Provisioning_Status=properties.provisioningState |
| 92 | +``` |
0 commit comments