ModifyPrometheusScrapeJob#

Description#

Request to modify a data scrape job for Prometheus service.

Request Parameters#

  • jobId — The ID of the scape job.

    • Type: String

    • Required: Yes

  • parameters — The scrape job parameters.

    • Type: Dict

    • Required: Yes

  • serviceId — The PaaS service ID.

    • Type: String

    • Required: Yes

Response Elements#

  • prometheusScrapeJob — Information about the modified scrape job.

Examples#

Managing PaaS services in NGN Cloud via API requires a customized version of the boto3 library:

import boto3

session = boto3.Session(
    aws_access_key_id="<AWS_ACCESS_KEY_ID>",
    aws_secret_access_key="<AWS_SECRET_ACCESS_KEY>",
    region_name="ngn",
)

paas_client = session.client(
    "paas",
    endpoint_url='https://paas.cloud.ngn.com.tr/',
)

route = paas_client.modify_prometheus_scrape_job(
    serviceId='fm-cluster-1ACD3963',
    jobId="prometheus-scrape-job-772E84CA",
    parameters={
        "targets": ["192.168.1.150:443"],
        "labels": {
            "node": "gitlab",
            "environment": "prod",
        }
    }
)

Or c2-paas utility from CROC Cloud API Client software suite:

c2-paas ModifyPrometheusScrapeJob serviceId fm-cluster-1ACD3963 jobId prometheus-scrape-job-772E84CA parameters.targets.0 "192.168.1.151:443" parameters.labels.node gitlab parameters.labels.environment prod