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.
You can currently query the following attributes and connections on an Azure CDN Origins
query {
queryazureCdnOrigin {
id
subscriptionId
region
name
type
kind
createdBy
createdByType
createdAt
lastModifiedBy
lastModifiedByType
lastModifiedAt
hostName
httpPort
httpsPort
originHostHeader
priority
weight
enabled
privateLinkAlias
privateLinkResourceId
privateLinkLocation
privateLinkApprovalMessage
resourceState
provisioningState
privateEndpointStatus
resourceGroup {
id
}
cdnEndpoints {
id
}
cdnOriginGroups {
id
}
}
}
Get data for a single Azure CDN Origin key that you know the ID for:
query {
getazureCdnOrigin(id: "12345") {
id
}
}
Get data for all of the CDN Origins in a certain Azure subscription:
query {
queryazureCdnOrigin(filter: { subscriptionId: { eq: "12345" } }) {
id
}
}
Get data for all of the CDN Origins that are NOT in a certain Azure subscription:
query {
queryazureCdnOrigin(filter: { not: { subscriptionId: { eq: "12345" } } }) {
id
}
}
Get data for all of the CDN Origins that are connected to a cdnEndpoint:
query {
queryazureCdnOrigin(filter: { has: cdnEndpoints }) {
id
}
}
You can order the results you get back either asc or desc depending on your preference:
query {
queryazureCdnOrigin(order: { desc: name }) {
id
}
}
Only select and return the first two CDN Origins that are found:
query {
queryazureCdnOrigin(first: 2, order: { desc: name }) {
id
}
}
Only select and return the first two CDN Origins that are found, but offset by one so keys two & three are returned:
query {
queryazureCdnOrigin(first: 2, order: { desc: name }, offset: 1) {
id
}
}
Count the number of CDN Origins across all scanned Azure subscriptions:
query {
aggregateazureCdnOrigin {
count
}
}
Count the number of CDN Origins in a single account. Note that you can apply all of the same filters that are listed above to aggregate queries:
query {
aggregateazureCdnOrigin(filter: { subscriptionId: { eq: "12345" } }) {
count
}
}
Find all of the CDN Origins that are in the eastus region across all your accounts:
query {
queryazureCdnOrigin(filter: { region: { eq: "eastus" } }) {
id
}
}
Get the CDN Endpoints for a given CDN Origin using advanced filtering:
query {
queryazureCdnOrigin (
filter: {
region: { eq: "eastus" }
name: { regexp: "/.*name-of-project*/" }
has: cdnEndpoints
}
) {
cdnEndpoints {
id
}
}
}
With CloudGraph you can run multiple queries at the same time so you can combine the above two queries if you like:
query {
aggregateazureCdnOrigin(filter: { region: { eq: "eastus" } }) {
count
}
queryazureCdnOrigin (
filter: {
region: { eq: "eastus" }
name: { regexp: "/.*name-of-project*/" }
has: cdnEndpoints
}
) {
cdnEndpoints {
id
}
}
}
Putting it all together; get all data for all CDN Origins 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, cdnOrigins -> cdnEndpoints -> cdnCustomDomains ...etc:
query {
queryazureCdnOrigin {
id
subscriptionId
region
name
type
kind
createdBy
createdByType
createdAt
lastModifiedBy
lastModifiedByType
lastModifiedAt
hostName
httpPort
httpsPort
originHostHeader
priority
weight
enabled
privateLinkAlias
privateLinkResourceId
privateLinkLocation
privateLinkApprovalMessage
resourceState
provisioningState
privateEndpointStatus
resourceGroup {
id
name
type
kind
subscriptionId
region
managedBy
disks {
id
}
dns {
id
}
firewalls {
id
}
functionApps {
id
}
keyVaults {
id
}
networkInterfaces {
id
}
publicIps {
id
}
securityGroups {
id
}
storageAccounts {
id
}
storageContainers {
id
}
virtualMachines {
id
}
virtualNetworks {
id
}
tags{
id
key
value
}
}
cdnEndpoints {
id
subscriptionId
region
name
type
kind
originPath
contentTypesToCompress
originHostHeader
isCompressionEnabled
isHttpAllowed
isHttpsAllowed
queryStringCachingBehavior
optimizationType
probePath
geoFilters {
id
relativePath
action
countryCodes
}
defaultOriginGroupId
urlSigningKeys {
id
keySourceParameters {
odataType
subscriptionId
resourceGroupName
vaultName
secretName
secretVersion
}
}
deliveryPolicy {
description
rules {
id
name
order
conditions {
id
name
parameters {
odataType
selector
operator
negateCondition
matchValues
transforms
}
}
actions {
id
name
parameters {
odataType
redirectType
destinationProtocol
customPath
customHostname
customQueryString
customFragment
algorithm
parameterNameOverride {
id
paramIndicator
paramName
}
originGroup {
id
}
sourcePattern
destination
preserveUnmatchedPath
headerAction
headerName
value
cacheBehavior
cacheType
cacheDuration
queryStringBehavior
queryParameters
}
}
}
}
webApplicationFirewallPolicyLinkId
hostName
resourceState
provisioningState
tags {
id
key
value
}
resourceGroup {
id
}
cdnProfiles {
id
}
cdnCustomDomains {
id
}
cdnOrigins {
id
}
cdnOriginGroups {
id
}
}
cdnOriginGroups {
id
subscriptionId
region
name
type
kind
createdBy
createdByType
createdAt
lastModifiedBy
lastModifiedByType
lastModifiedAt
healthProbeSettings {
probePath
probeRequestType
probeProtocol
probeIntervalInSeconds
}
trafficRestorationTimeToHealedOrNewEndpointsInMinutes
responseBasedOriginErrorDetectionSettings {
responseBasedDetectedErrorTypes
responseBasedFailoverThresholdPercentage
httpErrorRanges {
id
begin
end
}
}
resourceState
provisioningState
resourceGroup {
id
}
cdnEndpoints {
id
}
cdnOrigins {
id
}
}
}
}