Monitors as Code (GraphQL)

Related queries and mutations in Monitors as Code. Each has its own section.

Queries

exportDimensionTrackingMonitorMigrationTemplates (query)

exportDimensionTrackingMonitorMigrationTemplates is a query in the Monte Carlo GraphQL API, in Monitors as Code. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Export Monte Carlo config templates for migrated Dimension Tracking monitors.

Arguments

ArgumentTypeDescription
namespaceStringFilter results to the given namespace only.
validateBooleanWhether to validate the exported config template Default: true.

Returns

MonteCarloConfigTemplateExportResponse

Example

query ExportDimensionTrackingMonitorMigrationTemplates {
  exportDimensionTrackingMonitorMigrationTemplates {
    configTemplateAsYaml
    errors
  }
}

Related types

MonteCarloConfigTemplateExportResponse

exportLatestVersionMonitorReplacementTemplates (query)

exportLatestVersionMonitorReplacementTemplates is a query in the Monte Carlo GraphQL API, in Monitors as Code. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Export Monte Carlo config templates for the latest-version replacements of the specified monitors. Currently only converts Dimension Tracking to Metric Monitor.

Arguments

ArgumentTypeDescription
monitorUuids[UUID!]!List of UUIDs for monitors to convert
namespaceStringNamespace to export monitors from. If neither namespace nor monitor UUID list is provided, all monitors will be exported
collectionLagHoursForDayGroupingIntCollection lag hours to use for monitors that group by day Default: 24.
collectionLagHoursForHourGroupingIntCollection lag hours to use for monitors that group by hour Default: 2.
validateBooleanWhether to validate the exported config template Default: true.

Returns

MonteCarloConfigTemplateExportResponse

Example

query ExportLatestVersionMonitorReplacementTemplates($monitorUuids: [UUID!]!) {
  exportLatestVersionMonitorReplacementTemplates(monitorUuids: $monitorUuids) {
    configTemplateAsYaml
    errors
  }
}

Related types

MonteCarloConfigTemplateExportResponse, UUID

exportMonteCarloConfigTemplates (query)

exportMonteCarloConfigTemplates is a query in the Monte Carlo GraphQL API, in Monitors as Code. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Export Monte Carlo config templates from existing custom monitors

Arguments

ArgumentTypeDescription
monitorUuids[UUID]List of custom monitor uuids to export
notificationUuids[UUID]List of notifications uuids to export
exportNameBooleanInclude the resource name in the export Default: false.

Returns

MonteCarloConfigTemplateExportResponse

Example

query ExportMonteCarloConfigTemplates {
  exportMonteCarloConfigTemplates {
    configTemplateAsYaml
    errors
  }
}

Related types

MonteCarloConfigTemplateExportResponse, UUID

getMonteCarloConfigTemplates (query)

getMonteCarloConfigTemplates is a query in the Monte Carlo GraphQL API, in Monitors as Code. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Get existing Monte Carlo config templates

Arguments

ArgumentTypeDescription
offsetInt
beforeString
afterString
firstInt
lastInt
namespaceString

Returns

MonteCarloConfigTemplateConnection

Example

query GetMonteCarloConfigTemplates {
  getMonteCarloConfigTemplates {
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}

Related types

MonteCarloConfigTemplateConnection

getMonteCarloConfigTemplateUpdateState (query)

getMonteCarloConfigTemplateUpdateState is a query in the Monte Carlo GraphQL API, in Monitors as Code. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Get result of async Monte Carlo config template update

Arguments

ArgumentTypeDescription
updateUuidUUID!UUID of update to fetch result for

Returns

MonteCarloConfigTemplateUpdateAsyncState

Example

query GetMonteCarloConfigTemplateUpdateState($updateUuid: UUID!) {
  getMonteCarloConfigTemplateUpdateState(updateUuid: $updateUuid) {
    changesApplied
    errorsAsJson
    warningsAsJson
    infoAsJson
    state
  }
}

Types used only by getMonteCarloConfigTemplateUpdateState

MonteCarloConfigTemplateUpdateAsyncState

Object type. Monte Carlo Config Template Update Async State

FieldTypeDescription
resourceModifications[ResourceModification]List of resource modifications
changesAppliedBooleanChanges applied?
errorsAsJsonStringErrors encountered
warningsAsJsonStringWarnings encountered
infoAsJsonStringInformational messages
stateState!State of the async update
State

Enum type.

ValueDescription
PENDING
SKIPPED
APPLIED
FAILED

Related types

ResourceModification, UUID

Mutations

convertConfigTemplateToUiMonitors (mutation)

convertConfigTemplateToUiMonitors is a mutation in the Monte Carlo GraphQL API, in Monitors as Code. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Convert a config template to UI Monitors

Arguments

ArgumentTypeDescription
dryRunBooleanDry run? Default: false.
namespaceString!Namespace of config template

Returns

ConvertConfigTemplateToUiMonitors

Example

mutation ConvertConfigTemplateToUiMonitors($namespace: String!) {
  convertConfigTemplateToUiMonitors(namespace: $namespace) {
    response {
      monitors {
        uuid
        creatorId
        monitorType
        name
        accountUuid
        udmType
        resourceId
        updaterId
        entities
        projects
        datasets
        ruleDescription
        ruleVariables
        monitorFields
        monitorTimeAxisFieldName
        monitorTimeAxisFieldType
        monitorTimeAxisTimezone
        createdTime
        lastUpdateTime
        scheduleType
      }
    }
  }
}

Types used only by convertConfigTemplateToUiMonitors

ConvertConfigTemplateToUiMonitors

Object type. Convert a config template to UI Monitors

FieldTypeDescription
responseConvertConfigTemplateToUiMonitorsOutputExported template
ConvertConfigTemplateToUiMonitorsOutput

Object type. Convert config template to UI monitors response

FieldTypeDescription
monitors[UserDefinedMonitorV2]Converted monitors

Related types

UserDefinedMonitorV2

convertUiMonitorsToConfigTemplate (mutation)

convertUiMonitorsToConfigTemplate is a mutation in the Monte Carlo GraphQL API, in Monitors as Code. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Convert a set of monitors to a config template

Arguments

ArgumentTypeDescription
allMonitorsBooleanConvert all UI monitors Default: false.
dryRunBooleanDry run? Default: false.
monitorUuids[UUID]Monitor IDs to convert
namespaceString!Namespace of config template

Returns

ConvertUiMonitorsToConfigTemplate

Example

mutation ConvertUiMonitorsToConfigTemplate($namespace: String!) {
  convertUiMonitorsToConfigTemplate(namespace: $namespace) {
    response {
      configTemplateAsYaml
      configTemplateAsDict
      errors
      warnings
    }
  }
}

Types used only by convertUiMonitorsToConfigTemplate

ConvertUiMonitorsToConfigTemplate

Object type. Convert a set of monitors to a config template

FieldTypeDescription
responseConvertUiMonitorsToConfigTemplateOutputExported template
ConvertUiMonitorsToConfigTemplateOutput

Object type. Convert monitors to config template response

FieldTypeDescription
monitors[UserDefinedMonitor]Converted monitors
configTemplateAsYamlStringConfig Template as YAML
configTemplateAsDictJSONStringConfig Template as a dictionary
errors[String]Errors encountered
warnings[String]Warnings encountered

Related types

JSONString, UUID, UserDefinedMonitor

createOrUpdateMonteCarloConfigTemplate (mutation)

createOrUpdateMonteCarloConfigTemplate is a mutation in the Monte Carlo GraphQL API, in Monitors as Code. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Create or update a Monte Carlo Config Template

Arguments

ArgumentTypeDescription
configTemplateJsonString!Monte Carlo Template in JSON format
createNonIngestedTablesBooleanCreate non-existent tables
domainStringDefault domain name or ID for monitors that omit a domain.
dryRunBooleanDry run?
misconfiguredAsWarningBooleanMisconfigured errors as warnings
namespaceString!Namespace of config template
resourceStringDefault resource (warehouse) ID or name. DEPRECATED: use warehouse instead.
sqlValidationBooleanEnable SQL syntax validation and pre-save warehouse checks, including the cost availability check (default: true)
warehouseStringDefault warehouse ID or name

Returns

CreateOrUpdateMonteCarloConfigTemplate

Example

mutation CreateOrUpdateMonteCarloConfigTemplate($configTemplateJson: String!, $namespace: String!) {
  createOrUpdateMonteCarloConfigTemplate(configTemplateJson: $configTemplateJson, namespace: $namespace) {
    response {
      changesApplied
      errorsAsJson
      warningsAsJson
      infoAsJson
    }
  }
}

Types used only by createOrUpdateMonteCarloConfigTemplate

CreateOrUpdateMonteCarloConfigTemplate

Object type. Create or update a Monte Carlo Config Template

FieldTypeDescription
responseMonteCarloConfigTemplateUpdateResponseResponse
MonteCarloConfigTemplateUpdateResponse

Object type. Monte Carlo Config Template Update Response

FieldTypeDescription
resourceModifications[ResourceModification]List of resource modifications
changesAppliedBooleanChanges applied?
errorsAsJsonStringErrors encountered
warningsAsJsonStringWarnings encountered
infoAsJsonStringInformational messages

Related types

ResourceModification

createOrUpdateMonteCarloConfigTemplateAsync (mutation)

createOrUpdateMonteCarloConfigTemplateAsync is a mutation in the Monte Carlo GraphQL API, in Monitors as Code. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Create or update a Monte Carlo Config Template asynchronously

Arguments

ArgumentTypeDescription
configTemplateJsonString!Monte Carlo Template in JSON format
createNonIngestedTablesBooleanCreate non-existent tables
domainStringDefault domain name or ID for monitors that omit a domain.
dryRunBooleanDry run?
misconfiguredAsWarningBooleanMisconfigured errors as warnings
namespaceString!Namespace of config template
resourceStringDefault resource (warehouse) ID or name. DEPRECATED: use warehouse instead.
sqlValidationBooleanEnable SQL syntax validation and pre-save warehouse checks, including the cost availability check (default: true)
warehouseStringDefault warehouse ID or name

Returns

CreateOrUpdateMonteCarloConfigTemplateAsync

Example

mutation CreateOrUpdateMonteCarloConfigTemplateAsync($configTemplateJson: String!, $namespace: String!) {
  createOrUpdateMonteCarloConfigTemplateAsync(configTemplateJson: $configTemplateJson, namespace: $namespace) {
    response {
      updateUuid
      errorsAsJson
      warningsAsJson
    }
  }
}

Types used only by createOrUpdateMonteCarloConfigTemplateAsync

CreateOrUpdateMonteCarloConfigTemplateAsync

Object type. Create or update a Monte Carlo Config Template asynchronously

FieldTypeDescription
responseMonteCarloConfigTemplateUpdateAsyncResponseResponse
MonteCarloConfigTemplateUpdateAsyncResponse

Object type. Monte Carlo Config Template Update Async Response

FieldTypeDescription
updateUuidUUIDThe UUID of the requested update. Used to poll for the status of the update. Null if the update request is invalid.
errorsAsJsonStringErrors encountered
warningsAsJsonStringWarnings encountered

Related types

UUID

deleteMonteCarloConfigTemplate (mutation)

deleteMonteCarloConfigTemplate is a mutation in the Monte Carlo GraphQL API, in Monitors as Code. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Delete a Monte Carlo Config Template

Arguments

ArgumentTypeDescription
dryRunBooleanDry run?
namespaceString!Namespace of config template

Returns

DeleteMonteCarloConfigTemplate

Example

mutation DeleteMonteCarloConfigTemplate($namespace: String!) {
  deleteMonteCarloConfigTemplate(namespace: $namespace) {
    response {
      numDeleted
      changesApplied
    }
  }
}

Types used only by deleteMonteCarloConfigTemplate

DeleteMonteCarloConfigTemplate

Object type. Delete a Monte Carlo Config Template

FieldTypeDescription
responseMonteCarloConfigTemplateDeleteResponseResponse
MonteCarloConfigTemplateDeleteResponse

Object type. Monte Carlo Config Template Delete Response

FieldTypeDescription
numDeletedIntNumber of resources deleted
changesAppliedBooleanChanges applied?

Source: The GraphQL API reference

This page is generated from the GraphQL schema on each release. Changes made in ReadMe are overwritten.