Policy types for @turbot/servicenow-gcp-functions

GCP > Functions > Function > ServiceNow

URI
tmod:@turbot/servicenow-gcp-functions#/policy/types/functionServiceNow
Targets

GCP > Functions > Function > ServiceNow > Configuration Item

Synchronize the data for the GCP > Functions > Function based on the policies GCP > Functions > Function > ServiceNow > Configuration Item > *

The Configuration Item control is responsible for automatically synchronizing records in a designated ServiceNow table, maintaining an up-to-date reflection of the GCP > Functions > Function information within the ServiceNow CMDB.

URI
tmod:@turbot/servicenow-gcp-functions#/policy/types/functionServiceNowConfigurationItem
Valid Value
[
"Skip",
"Check: Archived",
"Check: Deleted",
"Check: Sync",
"Enforce: Archived",
"Enforce: Deleted",
"Enforce: Sync",
"Enforce: Sync, archive on delete"
]
Schema
{
"type": "string",
"enum": [
"Skip",
"Check: Archived",
"Check: Deleted",
"Check: Sync",
"Enforce: Archived",
"Enforce: Deleted",
"Enforce: Sync",
"Enforce: Sync, archive on delete"
],
"example": [
"Skip"
],
"default": "Skip"
}

GCP > Functions > Function > ServiceNow > Configuration Item > Record

The policy facilitates the accurate representation of cloud resource within the ServiceNow environment, ensuring that critical data is effectively mapped and managed. Attribute of an GCP > Functions > Function is systematically mapped to a specific column in a ServiceNow table.

The policy allows enabling organizations to select and map only those attributes that are most relevant to their operational needs. It significantly reduces the manual effort involved in data transfer and minimizes the risk of errors, thereby enhancing the overall efficiency of data management.

URI
tmod:@turbot/servicenow-gcp-functions#/policy/types/functionServiceNowConfigurationItemRecord
Default Template Input
"{\n resource: function{\n data\n metadata\n turbot {\n akas\n id\n tags\n title\n }\n }\n}\n"
Default Template
"all_traffic_on_latest_revision: {{ $.resource.data.serviceConfig.allTrafficOnLatestRevision | dump | safe }}\navailable_cpu: {{ $.resource.data.serviceConfig.availableCpu | dump | safe }}\navailable_memory: {{ $.resource.data.serviceConfig.availableMemory | dump | safe }}\nbuild: {{ $.resource.data.buildConfig.build | dump | safe }}\ncreate_time: {{ $.resource.data.createTime | dump | safe }}\ncreated_by: {{ $.resource.metadata.createdBy | dump | safe }}\ndocker_registry: {{ $.resource.data.buildConfig.dockerRegistry | dump | safe }}\ndocker_repository: {{ $.resource.data.buildConfig.dockerRepository | dump | safe }}\nentry_point: {{ $.resource.data.buildConfig.entryPoint | dump | safe }}\nfunction_environment: {{ $.resource.data.environment | dump | safe }}\nfunction_name: {{ $.resource.data.name | dump | safe }}\niam_policy: {{ $.resource.data.iamPolicy | dump | safe }}\ningress_settings: {{ $.resource.data.serviceConfig.ingressSettings | dump | safe }}\nlabels: {{ $.resource.data.labels | dump | safe }}\nmax_instance_count: {{ $.resource.data.serviceConfig.maxInstanceCount | dump | safe }}\nmax_instance_request_concurrency: {{ $.resource.data.serviceConfig.maxInstanceRequestConcurrency | dump | safe }}\nproject_id: {{ $.resource.metadata.gcp.projectId | dump | safe }}\nregion_name: {{ $.resource.metadata.gcp.regionName | dump | safe }}\nrevision: {{ $.resource.data.serviceConfig.revision | dump | safe }}\nruntime: {{ $.resource.data.buildConfig.runtime | dump | safe }}\nservice: {{ $.resource.data.serviceConfig.service | dump | safe }}\nservice_account_email: {{ $.resource.data.serviceConfig.serviceAccountEmail | dump | safe }}\nsource_provenance: {{ $.resource.data.buildConfig.sourceProvenance | dump | safe }}\nstate: {{ $.resource.data.state | dump | safe }}\nstorage_source: {{ $.resource.data.buildConfig.source.storageSource | dump | safe }}\ntimeout_seconds: {{ $.resource.data.serviceConfig.timeoutSeconds | dump | safe }}\nupdate_time: {{ $.resource.data.updateTime | dump | safe }}\nuri: {{ $.resource.data.serviceConfig.uri | dump | safe }}\nurl: {{ $.resource.data.url | dump | safe }}\n"
Schema
{
"type": "object"
}

GCP > Functions > Function > ServiceNow > Configuration Item > Table Definition

This policy specifically allows users to define two key aspects: the name of the ServiceNow table where the GCP > Functions > Function data will be stored, and the details of the columns used for archiving purposes.

URI
tmod:@turbot/servicenow-gcp-functions#/policy/types/functionServiceNowConfigurationItemTableDefinition
Default Template Input
[
"{\n serviceNowInstance: resources(filter: \"resourceTypeId:tmod:@turbot/servicenow#/resource/types/instance level:self limit:1\") {\n items {\n turbot {\n id\n }\n }\n }\n}\n",
"{\n tableDefinition: policyValues(filter: \"policyTypeId:tmod:@turbot/servicenow-gcp-functions#/policy/types/functionServiceNowTableDefinition resourceId:{{$.serviceNowInstance.items[0].turbot.id}} level:self\") {\n items {\n value\n }\n }\n applicationScope: policyValues(filter: \"policyTypeId:tmod:@turbot/servicenow#/policy/types/serviceNowApplicationScope resourceId:{{$.serviceNowInstance.items[0].turbot.id}} level:self\") {\n items {\n value\n }\n }\n}\n"
]
Default Template
"tableName: "{%- if $.applicationScope.items | length == 0 or $.tableDefinition.items | length == 0 %} {%- else %}{{$.applicationScope.items[0].value}}_{{$.tableDefinition.items[0].value.table.name | lower}}{% endif %}"\n"
Schema
{
"type": "object",
"additionalProperties": false,
"required": [
"tableName"
],
"properties": {
"tableName": {
"type": "string"
},
"archiveColumns": {
"type": "object"
}
}
}

GCP > Functions > Function > ServiceNow > Table

Configure a Table for GCP > Functions > Function resource type in ServiceNow via the GCP > Functions > Function > ServiceNow > Table > * policies.

URI
tmod:@turbot/servicenow-gcp-functions#/policy/types/functionServiceNowTable
Valid Value
[
"Skip",
"Check: Configured",
"Enforce: Configured"
]
Schema
{
"type": "string",
"enum": [
"Skip",
"Check: Configured",
"Enforce: Configured"
],
"example": [
"Skip"
],
"default": "Skip"
}

GCP > Functions > Function > ServiceNow > Table > Definition

The policy enables the definition of ServiceNow table properties, including its name and the base table from which it extends, and details the specific columns required for representing GCP > Functions > Function data.

URI
tmod:@turbot/servicenow-gcp-functions#/policy/types/functionServiceNowTableDefinition
Schema
{
"type": "object",
"additionalProperties": false,
"required": [
"table",
"columns"
],
"properties": {
"table": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"pattern": "^([0-9a-z_])+$"
},
"label": {
"type": "string"
},
"extendsTable": {
"type": "string",
"pattern": "^([0-9a-z_])+$"
}
}
},
"columns": {
"type": "array",
"description": "An array of columns with their mappings to the CMDB.",
"default": [],
"items": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "The name of the column in the table.",
"pattern": "^([0-9a-z_])+$"
},
"label": {
"type": "string",
"description": "The label for the column."
},
"type": {
"description": "The data type of the column.",
"type": "string"
},
"size": {
"type": "integer",
"description": "The length for data type."
}
}
}
}
},
"default": {
"table": {
"name": "guardrails_gcp_functions_function",
"label": "GCP > Functions > Function",
"extendsTable": "cmdb_ci"
},
"columns": [
{
"name": "all_traffic_on_latest_revision",
"label": "All Traffic On Latest Revision",
"type": "boolean"
},
{
"name": "available_cpu",
"label": "Available CPU"
},
{
"name": "available_memory",
"label": "Available Memory"
},
{
"name": "build",
"label": "Build"
},
{
"name": "create_time",
"label": "Create Time"
},
{
"name": "created_by",
"label": "Created By"
},
{
"name": "docker_registry",
"label": "Docker Registry"
},
{
"name": "docker_repository",
"label": "Docker Repository"
},
{
"name": "entry_point",
"label": "Entry Point"
},
{
"name": "function_environment",
"label": "Environment"
},
{
"name": "function_name",
"label": "Name"
},
{
"name": "iam_policy",
"label": "IAM Policy"
},
{
"name": "ingress_settings",
"label": "Ingress Settings"
},
{
"name": "labels",
"label": "Labels",
"type": "object",
"size": 1000
},
{
"name": "max_instance_count",
"label": "Max Instance Count",
"type": "integer"
},
{
"name": "max_instance_request_concurrency",
"label": "Max Instance Request Concurrency",
"type": "integer"
},
{
"name": "project_id",
"label": "Project ID"
},
{
"name": "region_name",
"label": "Region Name"
},
{
"name": "revision",
"label": "Revision"
},
{
"name": "runtime",
"label": "Runtime"
},
{
"name": "service",
"label": "Service"
},
{
"name": "service_account_email",
"label": "Service Account Email"
},
{
"name": "source_provenance",
"label": "Source Provenance",
"type": "object",
"size": 1000
},
{
"name": "state",
"label": "State"
},
{
"name": "storage_source",
"label": "Storage Source",
"type": "object",
"size": 1000
},
{
"name": "timeout_seconds",
"label": "Timeout Seconds",
"type": "integer"
},
{
"name": "update_time",
"label": "Update Time"
},
{
"name": "uri",
"label": "URI"
},
{
"name": "url",
"label": "URL"
}
]
}
}