Agents (GraphQL)

Related queries and mutations in Agents and deployments. Each has its own section.

Queries

getAgentAwsExternalId (query)

getAgentAwsExternalId is a query in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: General availability

Read the IAM ExternalId currently configured for an AWS agent. Returns null if no ExternalId has been generated yet.

Arguments

ArgumentTypeDescription
agentIdUUID!UUID of the AWS agent.

Returns

AwsAgentExternalId

Example

query GetAgentAwsExternalId($agentId: UUID!) {
  getAgentAwsExternalId(agentId: $agentId) {
    externalId
  }
}

Related types

AwsAgentExternalId, UUID

getAgentOperationLogs (query)

getAgentOperationLogs is a query in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Get Agent operations log entries for a given time period, optionally matching a connection type

Arguments

ArgumentTypeDescription
agentIdUUID!Agent ID
startTimeDateTimeOptional start time, defaults to 10 minutes ago
endTimeDateTimeOptional end time, defaults to now
limitIntMaximum number of entries to return, defaults to 1000
connectionTypeStringOptional connection type, for example "snowflake", "redshift", etc.

Returns

[AgentLogEntry]

Example

query GetAgentOperationLogs($agentId: UUID!) {
  getAgentOperationLogs(agentId: $agentId) {
    timestamp
    payload
  }
}

Related types

AgentLogEntry, DateTime, UUID

getAwsAgentInfraDetails (query)

getAwsAgentInfraDetails is a query in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Get infrastructure information from an AWS Agent like CloudFormation template and parameters.

Arguments

ArgumentTypeDescription
agentIdUUID!Agent ID

Returns

AwsAgentInfraDetailsResult

Example

query GetAwsAgentInfraDetails($agentId: UUID!) {
  getAwsAgentInfraDetails(agentId: $agentId) {
    template
    parameters
  }
}

Types used only by getAwsAgentInfraDetails

AwsAgentInfraDetailsResult

Object type. Infrastructure information for an AWS Agent.

FieldTypeDescription
templateGenericScalar!The CloudFormation template, in YAML format
parameters[GenericScalar]!The current template parameters.

Related types

GenericScalar, UUID

getAwsAgentLogs (query)

getAwsAgentLogs is a query in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Get AWS Agent log entries for a given time period, optionally matching a filter

Arguments

ArgumentTypeDescription
agentIdUUID!AWS Agent ID
startTimeDateTimeOptional start time, defaults to 10 minutes ago
endTimeDateTimeOptional end time, defaults to now
limitIntMaximum number of entries to return, defaults to 1000
patternStringOptional pattern, for example: %text%

Returns

[AgentLogEntry]

Example

query GetAwsAgentLogs($agentId: UUID!) {
  getAwsAgentLogs(agentId: $agentId) {
    timestamp
    payload
  }
}

Related types

AgentLogEntry, DateTime, UUID

getAwsAgentUpgradeLogs (query)

getAwsAgentUpgradeLogs is a query in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Get AWS Agent upgrade log entries from a given start time.

Arguments

ArgumentTypeDescription
agentIdUUID!AWS Agent ID.
limitIntMaximum number of entries to return, defaults to 100
startTimeDateTimeOptional start time, defaults to 12 hours ago

Returns

[AwsAgentUpgradeLogEntry]

Example

query GetAwsAgentUpgradeLogs($agentId: UUID!) {
  getAwsAgentUpgradeLogs(agentId: $agentId) {
    timestamp
    logicalResourceId
    resourceStatus
    resourceStatusReason
    resourceType
  }
}

Types used only by getAwsAgentUpgradeLogs

AwsAgentUpgradeLogEntry

Object type. An upgrade log entry from an AWS agent.

FieldTypeDescription
timestampString!Timestamp for the log entry.
logicalResourceIdString!Resource ID.
resourceStatusString!Resource status, for example: 'UPDATE_COMPLETE'.
resourceStatusReasonStringReason for the status, for example: 'User Initiated'.
resourceTypeString!Resource type, for example: 'AWS::Lambda::Function'.

Related types

DateTime, UUID

getAwsLogsQueryResults (query)

getAwsLogsQueryResults is a query in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Get the results of a query started using start_aws_logs_query.

Arguments

ArgumentTypeDescription
agentIdUUID!Agent ID
queryIdString!The query_id as returned by start_aws_query

Returns

AwsAgentLogsQueryResult

Example

query GetAwsLogsQueryResults($agentId: UUID!, $queryId: String!) {
  getAwsLogsQueryResults(agentId: $agentId, queryId: $queryId) {
    status
    events
  }
}

Types used only by getAwsLogsQueryResults

AwsAgentLogsQueryResult

Object type. The result for a CloudWatch query, includes events and status.

FieldTypeDescription
statusString!The status of the query, for example Running or Complete
events[GenericScalar]!The log events.

Related types

GenericScalar, UUID

getAzureAgentLogs (query)

getAzureAgentLogs is a query in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Get Azure Agent log entries for a given time period, optionally matching a query

Arguments

ArgumentTypeDescription
agentIdUUID!Azure Agent ID
startTimeDateTimeOptional start time, defaults to 10 minutes ago
endTimeDateTimeOptional end time, defaults to now
limitIntMaximum number of entries to return, defaults to 1000
queryStringOptional query, for example: where message like "pattern"

Returns

[AgentLogEntry]

Example

query GetAzureAgentLogs($agentId: UUID!) {
  getAzureAgentLogs(agentId: $agentId) {
    timestamp
    payload
  }
}

Related types

AgentLogEntry, DateTime, UUID

getAzureAgentTasksSummary (query)

getAzureAgentTasksSummary is a query in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Get Durable Functions tasks summary for an Azure Agent.

Arguments

ArgumentTypeDescription
agentIdUUID!Azure Agent ID
createdTimeFromDateTimeOptional start time, defaults to 24 hours ago
createdTimeToDateTimeOptional end time, defaults to now

Returns

AzureAgentTasksSummary

Example

query GetAzureAgentTasksSummary($agentId: UUID!) {
  getAzureAgentTasksSummary(agentId: $agentId) {
    pendingInstances
    completedInstances
  }
}

Types used only by getAzureAgentTasksSummary

AzureAgentTasksSummary

Object type. Durable Functions tasks information for an Azure Agent.

FieldTypeDescription
pendingInstancesInt!Number of pending tasks.
completedInstancesInt!Number of completed tasks

Related types

DateTime, UUID

getGcpAgentLogs (query)

getGcpAgentLogs is a query in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Get GCP Agent log entries for a given time period, optionally matching a filter

Arguments

ArgumentTypeDescription
agentIdUUID!GCP Agent ID
limitIntMaximum number of entries to return, defaults to 1000
logsFilterStringOptional filter, for example: SEARCH("text") or timestamp >= "2023-01-01T00:00:00Z"

Returns

[AgentLogEntry]

Example

query GetGcpAgentLogs($agentId: UUID!) {
  getGcpAgentLogs(agentId: $agentId) {
    timestamp
    payload
  }
}

Related types

AgentLogEntry, UUID

getSnowflakeAgentLogs (query)

getSnowflakeAgentLogs is a query in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: General availability

Get Snowflake Agent log entries

Arguments

ArgumentTypeDescription
agentIdUUID!Snowflake Agent ID
limitIntMaximum number of entries to return, defaults to 1000

Returns

[AgentLogEntry]

Example

query GetSnowflakeAgentLogs($agentId: UUID!) {
  getSnowflakeAgentLogs(agentId: $agentId) {
    timestamp
    payload
  }
}

Related types

AgentLogEntry, UUID

startAwsLogsQuery (query)

startAwsLogsQuery is a query in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Get the results of a query started using start_aws_logs_query.

Arguments

ArgumentTypeDescription
agentIdUUID!Agent ID
startTimeDateTimeOptional start time, defaults to 10 minutes ago
endTimeDateTimeOptional end time, defaults to now
limitIntMaximum number of entries to return, defaults to 1000
queryString!The CloudWatch query following the syntax defined at: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html. For example: 'fields @timestamp, @message | filter @message like "error"'

Returns

AwsAgentStartLogsQueryResult

Example

query StartAwsLogsQuery($agentId: UUID!, $query: String!) {
  startAwsLogsQuery(agentId: $agentId, query: $query) {
    queryId
  }
}

Types used only by startAwsLogsQuery

AwsAgentStartLogsQueryResult

Object type. The result for start_query including the query ID.

FieldTypeDescription
queryIdString!The ID for the started query

Related types

DateTime, UUID

stopAwsLogsQuery (query)

stopAwsLogsQuery is a query in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Stops a query started using start_aws_logs_query.

Arguments

ArgumentTypeDescription
agentIdUUID!Agent ID
queryIdString!The query_id as returned by start_aws_query

Returns

AwsAgentLogsStopQueryResult

Example

query StopAwsLogsQuery($agentId: UUID!, $queryId: String!) {
  stopAwsLogsQuery(agentId: $agentId, queryId: $queryId) {
    success
  }
}

Types used only by stopAwsLogsQuery

AwsAgentLogsStopQueryResult

Object type. The result for stop_query.

FieldTypeDescription
successBoolean!Indicates if the query was successfully stopped

Related types

UUID

Mutations

cleanupAzureAgentTasks (mutation)

cleanupAzureAgentTasks is a mutation in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Cleanup Durable Functions tasks for an Azure Agent

Arguments

ArgumentTypeDescription
agentIdUUID!The UUID of the Azure Agent to cleanup Durable Functions tasks.
createdTimeFromDateTimeOptional start time, defaults to 10 years ago
createdTimeToDateTimeOptional end time, defaults to 10 minutes ago
includePendingBooleanInclude pending tasks in the cleanup, defaults to false.

Returns

AzureAgentCleanupTasks

Example

mutation CleanupAzureAgentTasks($agentId: UUID!) {
  cleanupAzureAgentTasks(agentId: $agentId) {
    deletedInstances
  }
}

Types used only by cleanupAzureAgentTasks

AzureAgentCleanupTasks

Object type.

FieldTypeDescription
deletedInstancesInt!Number of deleted tasks

Related types

DateTime, UUID

createOrUpdateAgent (mutation)

createOrUpdateAgent is a mutation in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Create or Update a Monte Carlo Agent

Arguments

ArgumentTypeDescription
additionalInfoJSONStringAdditional information for the agent, for now only account_name is supported and used by Snowflake agents for the endpoint value.
agentIdUUIDUUID of Agent to update.
agentTypeAgentTypeEnumThe type of Agent being deployed.
authTypeAuthTypeEnumThe type of authorization provided.
credentialsJSONStringJSON of credentials for Agent.
dataCollectorIdUUIDThe UUID of the Data Collector to associate the agent with.
dryRunBooleanDry run? Default: false.
endpointStringBucket name, IP address or URL of the agent.
friendlyNameStringDisplay name for the agent or data store. Also names the warehouse and connection created for a Snowflake agent.
imageBuildStringBuild number of agent image. Ignored if agent type is DATA_STORE_AGENT.
imageVersionStringThe image version of the Agent. Null if agent type is data_store.
platformPlatformTypeEnumThe cloud platform the agent is deployed on.
storageTypeStorageTypeEnumThe storage type of the Agent.
upgradeableBooleanBoolean if the agent is remote upgradeable.
validationNameStringRun only this single validation instead of the full sequence. Dry-run only (ignored when dry_run is false); lets the UI show per-check progress and short-circuit on prerequisite failures.
wrapperTypeStringThe wrapper type of the Agent.
wrapperVersionStringThe wrapper version of the Agent.

Returns

CreateOrUpdateAgent

Example

mutation CreateOrUpdateAgent {
  createOrUpdateAgent {
    agentId
    autoEnabled
  }
}

Types used only by createOrUpdateAgent

AuthTypeEnum

Enum type.

ValueDescription
GCP_JSON_SERVICE_ACCOUNT_KEY
GCP_WORKLOAD_IDENTITY_FEDERATION
AWS_VPCE
AWS_ASSUMABLE_ROLE
AZURE_STORAGE_ACCOUNT_KEYS
AZURE_FUNCTION_APP_KEY
AZURE_FUNCTION_SERVICE_PRINCIPAL
AZURE_STORAGE_SERVICE_PRINCIPAL
AWS_IAM_AUTH
MCD_SHA512
OAUTH2_CLIENT_CREDENTIALS
OAUTH2_PASSWORD
CUSTOM_AUTH_HEADERS
CreateOrUpdateAgent

Object type.

FieldTypeDescription
agentIdUUIDThe UUID of the agent that was created or updated.
validationResultTestCredentialsV2ResponseResult validating the provided parameters.
autoEnabledBooleanTrue when the agent was disabled before the update and the update enabled it. That happens once everything it was missing is supplied: its endpoint, and the credentials its platform and authentication type require. No separate updateAgentEnabled call is needed then. Always false on initial registration and on an update that leaves the enabled state unchanged. Also always false for Snowflake and generic agents, which are enabled with updateAgentEnabled instead.
StorageTypeEnum

Enum type.

ValueDescription
AZURE_BLOB
GCS
S3
SNOWFLAKE_INTERNAL_STAGE
S3_COMPATIBLE

Related types

AgentTypeEnum, JSONString, PlatformTypeEnum, TestCredentialsV2Response, UUID

deleteAgent (mutation)

deleteAgent is a mutation in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Delete a Monte Carlo Agent

Arguments

ArgumentTypeDescription
agentIdUUID!UUID of Agent to delete

Returns

DeleteAgent

Example

mutation DeleteAgent($agentId: UUID!) {
  deleteAgent(agentId: $agentId) {
    success
  }
}

Types used only by deleteAgent

DeleteAgent

Object type.

FieldTypeDescription
successBoolean

Related types

UUID

generateAgentAwsExternalId (mutation)

generateAgentAwsExternalId is a mutation in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: General availability

Generate or rotate the IAM ExternalId an AWS agent uses to assume the customer's role. The customer must configure the returned value in the role's trust policy before the agent can be enabled.

Arguments

ArgumentTypeDescription
agentIdUUID!UUID of the AWS agent to generate the ExternalId for.

Returns

GenerateAgentAwsExternalId

Example

mutation GenerateAgentAwsExternalId($agentId: UUID!) {
  generateAgentAwsExternalId(agentId: $agentId) {
    result {
      externalId
    }
  }
}

Types used only by generateAgentAwsExternalId

GenerateAgentAwsExternalId

Object type.

FieldTypeDescription
resultAwsAgentExternalId!The newly generated ExternalId.

Related types

AwsAgentExternalId, UUID

migrateConnectionFromSnowflakeAgent (mutation)

migrateConnectionFromSnowflakeAgent is a mutation in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Migrates a Snowflake Agent connection to another platform service

Arguments

ArgumentTypeDescription
connectionDetailsSnowflakeConnectionDetails!Connection parameters.
connectionIdUUID!UUID of Connection to migrate.
serviceUuidUUID!UUID of DC to migrate to.

Returns

MigrateConnectionFromSnowflakeAgent

Example

mutation MigrateConnectionFromSnowflakeAgent($connectionDetails: SnowflakeConnectionDetails!, $connectionId: UUID!, $serviceUuid: UUID!) {
  migrateConnectionFromSnowflakeAgent(connectionDetails: $connectionDetails, connectionId: $connectionId, serviceUuid: $serviceUuid) {
    success
  }
}

Types used only by migrateConnectionFromSnowflakeAgent

MigrateConnectionFromSnowflakeAgent

Object type.

FieldTypeDescription
successBooleanTrue if the connection was migrated successfully.

Related types

SnowflakeConnectionDetails, UUID

migrateConnectionToSnowflakeAgent (mutation)

migrateConnectionToSnowflakeAgent is a mutation in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Migrate an existing connection to a Snowflake Agent

Arguments

ArgumentTypeDescription
agentIdUUID!UUID of Agent to migrate to.
connectionIdUUID!UUID of Connection to migrate.

Returns

MigrateConnectionToSnowflakeAgent

Example

mutation MigrateConnectionToSnowflakeAgent($agentId: UUID!, $connectionId: UUID!) {
  migrateConnectionToSnowflakeAgent(agentId: $agentId, connectionId: $connectionId) {
    success
  }
}

Types used only by migrateConnectionToSnowflakeAgent

MigrateConnectionToSnowflakeAgent

Object type.

FieldTypeDescription
successBooleanTrue if the connection was migrated successfully.

Related types

UUID

restartAgent (mutation)

restartAgent is a mutation in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Restarts an agent, supported only for Azure agents.

Arguments

ArgumentTypeDescription
agentIdUUID!The UUID of the Agent to restart, supported only for Azure agents.
traceIdStringTrace ID for the request.

Returns

RestartAgent

Example

mutation RestartAgent($agentId: UUID!) {
  restartAgent(agentId: $agentId) {
    restartResult
  }
}

Types used only by restartAgent

RestartAgent

Object type.

FieldTypeDescription
restartResultGenericScalarThe result object returned from the agent.

Related types

GenericScalar, UUID

updateAgentEnabled (mutation)

updateAgentEnabled is a mutation in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: General availability

Updates the enabled state of an agent.

Arguments

ArgumentTypeDescription
agentIdUUID!The UUID of the Agent to upgrade.
dryRunBooleanIf true, runs the precondition + reachability check that an enable would perform but does not change the agent's state. Default: false.
enabledBoolean!Whether the agent should be enabled or not.

Returns

UpdateAgentEnabled

Example

mutation UpdateAgentEnabled($agentId: UUID!, $enabled: Boolean!) {
  updateAgentEnabled(agentId: $agentId, enabled: $enabled) {
    enableResult
  }
}

Types used only by updateAgentEnabled

UpdateAgentEnabled

Object type.

FieldTypeDescription
enableResultBoolean!The agent's enabled state after the call (unchanged when dry_run is true).
validationResultTestCredentialsV2ResponseResult of the reachability check performed when enabling. Null when disabling or when the agent was already in the requested state.

Related types

TestCredentialsV2Response, UUID

updateAgentParameters (mutation)

updateAgentParameters is a mutation in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Updates agent parameters like MemorySize or ConcurrentExecutions.

Arguments

ArgumentTypeDescription
agentIdUUID!The UUID of the Agent to update parameters.
parametersGenericScalarNew values for template parameters, for example: MemorySize=1024
traceIdStringTrace ID for the request.

Returns

UpdateAgentParameters

Example

mutation UpdateAgentParameters($agentId: UUID!) {
  updateAgentParameters(agentId: $agentId) {
    updateResult
  }
}

Types used only by updateAgentParameters

UpdateAgentParameters

Object type.

FieldTypeDescription
updateResultGenericScalarThe result object returned from the agent.

Related types

GenericScalar, UUID

upgradeAgent (mutation)

upgradeAgent is a mutation in the Monte Carlo GraphQL API, in Agents and deployments. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Upgrades a Monte Carlo Agent to a given version

Arguments

ArgumentTypeDescription
agentIdUUID!The UUID of the Agent to upgrade.
imageStringImage to upgrade the agent to (upgrades to the latest image by default).
parametersGenericScalarNew values for template parameters, for example: MemorySize=1024
timeoutIntTime to wait for the upgrade to complete
traceIdStringTrace ID for the request.

Returns

UpgradeAgent

Example

mutation UpgradeAgent($agentId: UUID!) {
  upgradeAgent(agentId: $agentId) {
    upgradeResult
  }
}

Types used only by upgradeAgent

UpgradeAgent

Object type.

FieldTypeDescription
upgradeResultGenericScalarThe result object returned from the agent.

Related types

GenericScalar, UUID

Source: The GraphQL API reference

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