The response body is
{
"name": "1",
"widgets": {
"ijklmnop-abcd-1234-91f0-f51f1825b788": {
"id": "ijklmnop-abcd-1234-91f0-f51f1825b788",
"width": 1760,
"content": {
"params": {
"data": [
0
],
"aggregations": [
],
"valueTypes": [
"none"
]
}
}
},
"abcdefgh-5678-90ds-ae27-abae62385a55": {
"id": "abcdefgh-5678-90ds-ae27-abae62385a55",
"width": 1240,
"content": {
"params": {
"data": 1,
"values": [],
"timestamps": []
}
}
}
}
}
Here I want to extract as well as check id and other parameters inside abcdefgh-5678-90ds-ae27-abae62385a55(uuid) in the body?
How to create n number of instances in GCP using rest api.
in AWS java SDK, there is a method withMaxCount where we specify number of ec2 instances.
Similarly is there anything for GCP compute.
You can use REST API in loop to create instances.
Example request will look something like this:
{
"kind": "compute#instance",
"name": "INSTANCE-NAME",
"zone": "projects/PROJECT-NAME/zones/us-central1-a",
"machineType": "projects/PROJECT-NAME/zones/us-central1-a/machineTypes/e2-medium",
"displayDevice": {
"enableDisplay": false
},
"metadata": {
"kind": "compute#metadata",
"items": []
},
"tags": {
"items": []
},
"disks": [
{
"kind": "compute#attachedDisk",
"type": "PERSISTENT",
"boot": true,
"mode": "READ_WRITE",
"autoDelete": true,
"deviceName": "INSTANCE-NAME",
"initializeParams": {
"sourceImage": "projects/debian-cloud/global/images/debian-10-buster-v20210122",
"diskType": "projects/PROJECT-NAME/zones/us-central1-a/diskTypes/pd-standard",
"diskSizeGb": "10",
"labels": {}
},
"diskEncryptionKey": {}
}
],
"canIpForward": false,
"networkInterfaces": [
{
"kind": "compute#networkInterface",
"subnetwork": "regions/us-central1/subnetworks/default",
"accessConfigs": [
{
"kind": "compute#accessConfig",
"name": "External NAT",
"type": "ONE_TO_ONE_NAT",
"networkTier": "PREMIUM"
}
],
"aliasIpRanges": []
}
],
"description": "",
"labels": {},
"scheduling": {
"preemptible": false,
"onHostMaintenance": "MIGRATE",
"automaticRestart": true,
"nodeAffinities": []
},
"deletionProtection": false,
"reservationAffinity": {
"consumeReservationType": "ANY_RESERVATION"
},
"serviceAccounts": [
{
"email": "111111111111-compute#developer.gserviceaccount.com",
"scopes": [
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring.write",
"https://www.googleapis.com/auth/servicecontrol",
"https://www.googleapis.com/auth/service.management.readonly",
"https://www.googleapis.com/auth/trace.append"
]
}
],
"shieldedInstanceConfig": {
"enableSecureBoot": false,
"enableVtpm": true,
"enableIntegrityMonitoring": true
},
"confidentialInstanceConfig": {
"enableConfidentialCompute": false
}
}
Replace it with your own project name and service account, and you can test it here.
I have a micro-service with spring-boot-2.2.4 with actuator. When I hit the /actuator/metrics/http.server.requests url, I'm getting below response.
{
"name": "http.server.requests",
"description": null,
"baseUnit": "milliseconds",
"measurements": [
{
"statistic": "COUNT",
"value": 77.0
},
{
"statistic": "TOTAL_TIME",
"value": 2272.891396
},
{
"statistic": "MAX",
"value": 0.0
}
],
"availableTags": [
{
"tag": "exception",
"values": [
"None"
]
},
{
"tag": "method",
"values": [
"GET"
]
},
{
"tag": "uri",
"values": [
"/queue/{queueId}",
"/actuator/metrics/{requiredMetricName}"
]
},
{
"tag": "outcome",
"values": [
"SUCCESS"
]
},
{
"tag": "status",
"values": [
"200"
]
}
]
}
In graphite server I'm able to get the count details but I'm unable to get the TOTAL_TIME metrics details. Can someone please help me to figure out this issue. Where can I get this TOTAL_TIME in graphite server UI.
I´m running the GO-CD Server and Agents as Alpine Docker containers on a linux machine
I´m adding several pipelines through the json config plugin. The Server seems to start the first Pipeline and upload all the materials. Then he triggers 2 downstream pipes who´ll fetch the materials.
The 2 Downstream pipelines are beeing scheduled and asingned to an agent but they are not starting.
I´ve stopped the stages to see if the error was still comming and they stopped too.
2018-08-29 15:34:28,029 ERROR [85#MessageListener for WorkFinder] JMSMessageListenerAdapter:77 - Exception thrown in message handling by listener com.thoughtworks.go.server.messaging.scheduling.WorkFinder#2c731a16
java.lang.NullPointerException: null
2018-08-29 15:34:36,919 ERROR [85#MessageListener for WorkFinder] JMSMessageListenerAdapter:77 - Exception thrown in message handling by listener com.thoughtworks.go.server.messaging.scheduling.WorkFinder#2c731a16
java.lang.NullPointerException: null
2018-08-29 15:34:38,040 ERROR [85#MessageListener for WorkFinder] JMSMessageListenerAdapter:77 - Exception thrown in message handling by listener com.thoughtworks.go.server.messaging.scheduling.WorkFinder#2c731a16
java.lang.NullPointerException: null
Thats how the some of the pipelines are configured in the repository
{
"format_version" : 3,
"group": "group1",
"name": "Test-Pipeline-Stage",
"label_template": "${COUNT}",
"enable_pipeline_locking" : false,
"parameters": [],
"materials": [
{
"type": "git",
"url": ""
}
],
"stages": [
{
"name": "Test",
"fetch_materials": true,
"never_cleanup_artifacts": false,
"clean_working_directory": false,
"approval" : null,
"jobs": [{
"name": "RunUnittestAndCoverage",
"run_instance_count" : "all",
"environment_variables": [],
"timeout": 1,
"tabs": [
{
"name": "coverage",
"path": "coverage/coverage.html/index.html"
}
],
"artifacts": [
{
"source":"project.tar.gz",
"destination":"project_source",
"type":"build"
},
{
"source": "test_result.xml",
"destination": "testoutput",
"type": "test"
},
{
"source": "coverage.html",
"destination": "coverage",
"type": "build"
},
{
"source": "coverage.xml",
"destination": "coverage",
"type": "build"
}
],
"tasks":[
{
"type": "exec",
"run_if": "passed",
"on_cancel": null,
"command":"tox"
},
{
"type":"exec",
"run_if": "passed",
"on_cancel": null,
"command":"/usr/bin/xmllint",
"arguments": [
"--format",
"test_resulto.xml",
"--output",
"test_result.xml"
]
},
{
"type":"exec",
"run_if": "passed",
"on_cancel": null,
"command": "/bin/ls",
"arguments":[
"-al"
]
},
{
"type":"exec",
"run_if": "passed",
"on_cancel": null,
"command": "/bin/tar",
"arguments":[
"-cvzf",
"project.tar.gz",
"/godata/pipelines/Test-Pipeline-Stage"
]
}
]
}
]
}
]
}
{
"format_version" : 3,
"group": "group1",
"name": "Docker-Deployment-Pipeline-Stage",
"label_template": "${COUNT}",
"enable_pipeline_locking" : false,
"parameters": [],
"materials": [
{
"type": "dependency",
"pipeline": "Build-Pipeline-Stage",
"stage": "BuildPythonProduct",
"name": "project_source"
},
{
"type": "dependency",
"pipeline": "Analyse-Pipeline-Stage",
"stage":"Analyse",
"name":"analyse_result"
}
],
"stages":[
{
"name": "BuildDockerImage",
"fetch_materials": true,
"never_cleanup_artifacts": false,
"clean_working_directory": false,
"approval" : null,
"jobs":[
{
"name": "BuildImage",
"run_instance_count" : "all",
"environment_variables": [],
"timeout": 1,
"tasks": [
{
"type": "fetch",
"artifact_origin": "gocd",
"run_if": "any",
"pipeline": "Build-Pipeline-Stage",
"stage": "BuildPythonProduct",
"job": "BuildAndUpLoadWheel",
"is_source_a_file": true,
"source": "docker/Dockerfile",
"destination": ""
},
{
"type": "fetch",
"artifact_origin": "gocd",
"run_if": "any",
"pipeline": "Build-Pipeline-Stage",
"stage": "BuildPythonProduct",
"job": "BuildAndUpLoadWheel",
"is_source_a_file": true,
"source": "docker/production.ini",
"destination": ""
},
{
"type":"exec",
"run_if": "passed",
"on_cancel": null,
"command":"/usr/bin/docker",
"arguments": [
"build",
"-t",
"project_creator",
"."
]
}
]
}
]
}
]
}
Below is the original response:
{
"emails": [
{
"type": "work",
"value": "bjensen#example.com"
}
],
"id": "2819c223-7f76-453a-919d-413861904646",
"phoneNumbers": [
{
"type": "work",
"value": "555-555-8377"
},
{
"type": "business",
"value": "555-555-8377"
}
],
"schemas": [
"urn:scim:schemas:core:1.0"
],
"userName": "bjensen"
}
And in the above response I would pass excludedAttributes=phoneNumbers.type and the response should be like below:
{
"emails": [
{
"type": "work",
"value": "bjensen#example.com"
}
],
"id": "2819c223-7f76-453a-919d-413861904646",
"phoneNumbers": [
{
"value": "555-555-8377"
},
{
"value": "555-555-8377"
}
],
"schemas": [
"urn:scim:schemas:core:1.0"
],
"userName": "bjensen"
}