Note: if you are running CloudGraph locally you can view the interactive, automatically generated documentation in either GraphQL Playground or Altair by clicking the docs button on the right-hand side of the screen. After reading the below information we highly suggest you use one of these tools to test your queries as they will autocomplete fields for you and let you know if your queries are valid before you even submit them.
Overview
You can currently query the following attributes and connections on an Azure CDN Origin Groups
GraphQL
|
query{queryazureCdnOriginGroup{idsubscriptionIdregionnametypekindcreatedBycreatedByTypecreatedAtlastModifiedBylastModifiedByTypelastModifiedAthealthProbeSettings{probePathprobeRequestTypeprobeProtocolprobeIntervalInSeconds}trafficRestorationTimeToHealedOrNewEndpointsInMinutesresponseBasedOriginErrorDetectionSettings{responseBasedDetectedErrorTypesresponseBasedFailoverThresholdPercentagehttpErrorRanges{idbeginend}}resourceStateprovisioningStateresourceGroup{id# Other fields and connections here...}cdnEndpoints{id# Other fields and connections here...}cdnOrigins{id# Other fields and connections here...}}}
Filtering
Get data for a single Azure CDN Origin Group key that you know the ID for:
GraphQL
|
query{getazureCdnOriginGroup(id:"12345"){id# Other fields and connections here...}}
Get data for all of the CDN Origin Groups in a certain Azure subscription:
GraphQL
|
query{queryazureCdnOriginGroup(filter:{subscriptionId:{eq:"12345"}}){id# Other fields and connections here...}}# Note that in addition to "subscriptionId" you can# Filter based on any of the following attributes:# id# name# type# kind# region# createdBy# createdByType# createdAt# lastModifiedBy# lastModifiedByType# lastModifiedAt# trafficRestorationTimeToHealedOrNewEndpointsInMinutes# resourceState# provisioningState# And the following Dgraph filters can also be applied:# has# and# or# not# regexp (regular expressions)# fulltext filters# alloftext# anyoftext
Get data for all of the CDN Origin Groups that are NOT in a certain Azure subscription:
GraphQL
|
query{queryazureCdnOriginGroup(filter:{not:{subscriptionId:{eq:"12345"}}}){id# Other fields and connections here...}}
Advanced Filtering
Get data for all of the CDN Origin Groups that are connected to a cdnEndpoint:
GraphQL
|
query{queryazureCdnOriginGroup(filter:{has:cdnEndpoints}){id# Other fields and connections here...}}# Note that in addition to "cdnEndpoints" you can filter# Using "has" based on any of the following attributes:# id# subscriptionId# name# type# kind# region# createdBy# createdByType# createdAt# lastModifiedBy# lastModifiedByType# lastModifiedAt# trafficRestorationTimeToHealedOrNewEndpointsInMinutes# resourceState# provisioningState# resourceGroup# cdnEndpoints
Ordering
You can order the results you get back either asc or desc depending on your preference:
GraphQL
|
query{queryazureCdnOriginGroup(order:{desc:name}){id# Other fields and connections here...}}# Note that in addition to "name" you can filter# Using "asc" or "desc" based on any of the following attributes:# id# subscriptionId# type# kind# region# createdBy# createdByType# createdAt# lastModifiedBy# lastModifiedByType# lastModifiedAt# trafficRestorationTimeToHealedOrNewEndpointsInMinutes# resourceState# provisioningState
Only select and return the first two CDN Origin Groups that are found:
GraphQL
|
query{queryazureCdnOriginGroup(first:2,order:{desc:name}){id# Other fields and connections here...}}
Only select and return the first two CDN Origin Groups that are found, but offset by one so keys two & three are returned:
GraphQL
|
query{queryazureCdnOriginGroup(first:2,order:{desc:name},offset:1){id# Other fields and connections here...}}
Aggregation
Count the number of CDN Origin Groups across all scanned Azure subscriptions:
GraphQL
|
query{aggregateazureCdnOriginGroup{count# Other fields and connections here...}}# Note that in addition to "count" you can request the# Following min and max values based on attributes of your CDN Origin Groups:# idMin# idMax# nameMin# nameMax# typeMin# typeMax# kindMin# kindMax# subscriptionIdMin# subscriptionIdMax# regionMin# regionMax# createdByMin# createdByMax# createdByTypeMin# createdByTypeMax# createdAtMin# createdAtMax# lastModifiedByMin# lastModifiedByv# lastModifiedByTypeMin# lastModifiedByTypeMax# lastModifiedAtMin# lastModifiedAtMax# trafficRestorationTimeToHealedOrNewEndpointsInMinutesMin# trafficRestorationTimeToHealedOrNewEndpointsInMinutesMax# resourceStateMin# resourceStateMax# provisioningStateMin# provisioningStateMax
Count the number of CDN Origin Groups in a single account. Note that you can apply all of the same filters that are listed above to aggregate queries:
GraphQL
|
query{aggregateazureCdnOriginGroup(filter:{subscriptionId:{eq:"12345"}}){count# Other fields and connections here...}}
Examples
Find all of the CDN Origin Groups that are in the eastus region across all your accounts:
GraphQL
|
query{queryazureCdnOriginGroup(filter:{region:{eq:"eastus"}}){id# Other fields and connections here...}}
Get the CDN Endpoints for a given CDN Origin Group using advanced filtering:
GraphQL
|
query{queryazureCdnOriginGroup(filter:{region:{eq:"eastus"}}){id# Other fields and connections here...}}
With CloudGraph you can run multiple queries at the same time so you can combine the above two queries if you like:
GraphQL
|
query{aggregateazureCdnOriginGroup(filter:{region:{eq:"eastus"}}){count# Other attributes and connections here...}queryazureCdnOriginGroup(filter:{region:{eq:"eastus"}name:{regexp:"/.*name-of-project*/"}has:cdnEndpoints}){cdnEndpoints{id# Other fields and connections here...}}}
Kitchen Sink
Putting it all together; get all data for all CDN Origin Groups across all regions for all scanned Azure subscriptions in a single query. For the purposes of this example, we will only get direct children of the keys but if you want to it's easy to go from say, cdnOriginGroups -> cdnEndpoints -> cdnOrigins ...etc:
GraphQL
|
query{queryazureCdnOriginGroup{idsubscriptionIdregionnametypekindcreatedBycreatedByTypecreatedAtlastModifiedBylastModifiedByTypelastModifiedAthealthProbeSettings{probePathprobeRequestTypeprobeProtocolprobeIntervalInSeconds}trafficRestorationTimeToHealedOrNewEndpointsInMinutesresponseBasedOriginErrorDetectionSettings{responseBasedDetectedErrorTypesresponseBasedFailoverThresholdPercentagehttpErrorRanges{idbeginend}}resourceStateprovisioningStateresourceGroup{idnametypekindsubscriptionIdregionmanagedBydisks{id# Other fields and connections here...}dns{id# Other fields and connections here...}firewalls{id# Other fields and connections here...}functionApps{id# Other fields and connections here...}keyVaults{id# Other fields and connections here...}networkInterfaces{id# Other fields and connections here...}publicIps{id# Other fields and connections here...}securityGroups{id# Other fields and connections here...}storageAccounts{id# Other fields and connections here...}storageContainers{id# Other fields and connections here...}virtualMachines{id# Other fields and connections here...}virtualNetworks{id# Other fields and connections here...}tags{idkeyvalue}}cdnEndpoints{idsubscriptionIdregionnametypekindoriginPathcontentTypesToCompressoriginHostHeaderisCompressionEnabledisHttpAllowedisHttpsAllowedqueryStringCachingBehavioroptimizationTypeprobePathgeoFilters{idrelativePathactioncountryCodes}defaultOriginGroupIdurlSigningKeys{idkeySourceParameters{odataTypesubscriptionIdresourceGroupNamevaultNamesecretNamesecretVersion}}deliveryPolicy{descriptionrules{idnameorderconditions{idnameparameters{odataTypeselectoroperatornegateConditionmatchValuestransforms}}actions{idnameparameters{odataTyperedirectTypedestinationProtocolcustomPathcustomHostnamecustomQueryStringcustomFragmentalgorithmparameterNameOverride{idparamIndicatorparamName}originGroup{id}sourcePatterndestinationpreserveUnmatchedPathheaderActionheaderNamevaluecacheBehaviorcacheTypecacheDurationqueryStringBehaviorqueryParameters}}}}webApplicationFirewallPolicyLinkIdhostNameresourceStateprovisioningStatetags{idkeyvalue}resourceGroup{id# Other fields and connections here...}cdnProfiles{id# Other fields and connections here...}cdnCustomDomains{id# Other fields and connections here...}cdnOrigins{id# Other fields and connections here...}cdnOriginGroups{id# Other fields and connections here...}}cdnOrigins{idsubscriptionIdregionnametypekindcreatedBycreatedByTypecreatedAtlastModifiedBylastModifiedByTypelastModifiedAthostNamehttpPorthttpsPortoriginHostHeaderpriorityweightenabledprivateLinkAliasprivateLinkResourceIdprivateLinkLocationprivateLinkApprovalMessageresourceStateprovisioningStateprivateEndpointStatusresourceGroup{id# Other fields and connections here...}cdnEndpoints{id# Other fields and connections here...}cdnOriginGroups{id# Other fields and connections here...}}}}