1. Packages
  2. Grafana Cloud
  3. API Docs
  4. connections
  5. MetricsEndpointScrapeJob
Grafana v0.16.3 published on Monday, Apr 7, 2025 by pulumiverse

grafana.connections.MetricsEndpointScrapeJob

Explore with Pulumi AI

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@pulumiverse/grafana";

const test = new grafana.connections.MetricsEndpointScrapeJob("test", {
    stackId: "1",
    name: "my-scrape-job",
    enabled: true,
    authenticationMethod: "basic",
    authenticationBasicUsername: "my-username",
    authenticationBasicPassword: "my-password",
    url: "https://grafana.com/metrics",
    scrapeIntervalSeconds: 120,
});
Copy
import pulumi
import pulumiverse_grafana as grafana

test = grafana.connections.MetricsEndpointScrapeJob("test",
    stack_id="1",
    name="my-scrape-job",
    enabled=True,
    authentication_method="basic",
    authentication_basic_username="my-username",
    authentication_basic_password="my-password",
    url="https://grafana.com/metrics",
    scrape_interval_seconds=120)
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana/connections"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := connections.NewMetricsEndpointScrapeJob(ctx, "test", &connections.MetricsEndpointScrapeJobArgs{
			StackId:                     pulumi.String("1"),
			Name:                        pulumi.String("my-scrape-job"),
			Enabled:                     pulumi.Bool(true),
			AuthenticationMethod:        pulumi.String("basic"),
			AuthenticationBasicUsername: pulumi.String("my-username"),
			AuthenticationBasicPassword: pulumi.String("my-password"),
			Url:                         pulumi.String("https://grafana.com/metrics"),
			ScrapeIntervalSeconds:       pulumi.Int(120),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Grafana = Pulumiverse.Grafana;

return await Deployment.RunAsync(() => 
{
    var test = new Grafana.Connections.MetricsEndpointScrapeJob("test", new()
    {
        StackId = "1",
        Name = "my-scrape-job",
        Enabled = true,
        AuthenticationMethod = "basic",
        AuthenticationBasicUsername = "my-username",
        AuthenticationBasicPassword = "my-password",
        Url = "https://grafana.com/metrics",
        ScrapeIntervalSeconds = 120,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.connections.MetricsEndpointScrapeJob;
import com.pulumi.grafana.connections.MetricsEndpointScrapeJobArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var test = new MetricsEndpointScrapeJob("test", MetricsEndpointScrapeJobArgs.builder()
            .stackId("1")
            .name("my-scrape-job")
            .enabled(true)
            .authenticationMethod("basic")
            .authenticationBasicUsername("my-username")
            .authenticationBasicPassword("my-password")
            .url("https://grafana.com/metrics")
            .scrapeIntervalSeconds(120)
            .build());

    }
}
Copy
resources:
  test:
    type: grafana:connections:MetricsEndpointScrapeJob
    properties:
      stackId: '1'
      name: my-scrape-job
      enabled: true
      authenticationMethod: basic
      authenticationBasicUsername: my-username
      authenticationBasicPassword: my-password
      url: https://grafana.com/metrics
      scrapeIntervalSeconds: 120
Copy

Create MetricsEndpointScrapeJob Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new MetricsEndpointScrapeJob(name: string, args: MetricsEndpointScrapeJobArgs, opts?: CustomResourceOptions);
@overload
def MetricsEndpointScrapeJob(resource_name: str,
                             args: MetricsEndpointScrapeJobArgs,
                             opts: Optional[ResourceOptions] = None)

@overload
def MetricsEndpointScrapeJob(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             authentication_method: Optional[str] = None,
                             stack_id: Optional[str] = None,
                             url: Optional[str] = None,
                             authentication_basic_password: Optional[str] = None,
                             authentication_basic_username: Optional[str] = None,
                             authentication_bearer_token: Optional[str] = None,
                             enabled: Optional[bool] = None,
                             name: Optional[str] = None,
                             scrape_interval_seconds: Optional[int] = None)
func NewMetricsEndpointScrapeJob(ctx *Context, name string, args MetricsEndpointScrapeJobArgs, opts ...ResourceOption) (*MetricsEndpointScrapeJob, error)
public MetricsEndpointScrapeJob(string name, MetricsEndpointScrapeJobArgs args, CustomResourceOptions? opts = null)
public MetricsEndpointScrapeJob(String name, MetricsEndpointScrapeJobArgs args)
public MetricsEndpointScrapeJob(String name, MetricsEndpointScrapeJobArgs args, CustomResourceOptions options)
type: grafana:connections:MetricsEndpointScrapeJob
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. MetricsEndpointScrapeJobArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. MetricsEndpointScrapeJobArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. MetricsEndpointScrapeJobArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. MetricsEndpointScrapeJobArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. MetricsEndpointScrapeJobArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var metricsEndpointScrapeJobResource = new Grafana.Connections.MetricsEndpointScrapeJob("metricsEndpointScrapeJobResource", new()
{
    AuthenticationMethod = "string",
    StackId = "string",
    Url = "string",
    AuthenticationBasicPassword = "string",
    AuthenticationBasicUsername = "string",
    AuthenticationBearerToken = "string",
    Enabled = false,
    Name = "string",
    ScrapeIntervalSeconds = 0,
});
Copy
example, err := connections.NewMetricsEndpointScrapeJob(ctx, "metricsEndpointScrapeJobResource", &connections.MetricsEndpointScrapeJobArgs{
	AuthenticationMethod:        pulumi.String("string"),
	StackId:                     pulumi.String("string"),
	Url:                         pulumi.String("string"),
	AuthenticationBasicPassword: pulumi.String("string"),
	AuthenticationBasicUsername: pulumi.String("string"),
	AuthenticationBearerToken:   pulumi.String("string"),
	Enabled:                     pulumi.Bool(false),
	Name:                        pulumi.String("string"),
	ScrapeIntervalSeconds:       pulumi.Int(0),
})
Copy
var metricsEndpointScrapeJobResource = new MetricsEndpointScrapeJob("metricsEndpointScrapeJobResource", MetricsEndpointScrapeJobArgs.builder()
    .authenticationMethod("string")
    .stackId("string")
    .url("string")
    .authenticationBasicPassword("string")
    .authenticationBasicUsername("string")
    .authenticationBearerToken("string")
    .enabled(false)
    .name("string")
    .scrapeIntervalSeconds(0)
    .build());
Copy
metrics_endpoint_scrape_job_resource = grafana.connections.MetricsEndpointScrapeJob("metricsEndpointScrapeJobResource",
    authentication_method="string",
    stack_id="string",
    url="string",
    authentication_basic_password="string",
    authentication_basic_username="string",
    authentication_bearer_token="string",
    enabled=False,
    name="string",
    scrape_interval_seconds=0)
Copy
const metricsEndpointScrapeJobResource = new grafana.connections.MetricsEndpointScrapeJob("metricsEndpointScrapeJobResource", {
    authenticationMethod: "string",
    stackId: "string",
    url: "string",
    authenticationBasicPassword: "string",
    authenticationBasicUsername: "string",
    authenticationBearerToken: "string",
    enabled: false,
    name: "string",
    scrapeIntervalSeconds: 0,
});
Copy
type: grafana:connections:MetricsEndpointScrapeJob
properties:
    authenticationBasicPassword: string
    authenticationBasicUsername: string
    authenticationBearerToken: string
    authenticationMethod: string
    enabled: false
    name: string
    scrapeIntervalSeconds: 0
    stackId: string
    url: string
Copy

MetricsEndpointScrapeJob Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The MetricsEndpointScrapeJob resource accepts the following input properties:

AuthenticationMethod This property is required. string
Method to pass authentication credentials: basic or bearer.
StackId This property is required. string
Url This property is required. string
The url to scrape metrics from; a valid HTTPs URL is required.
AuthenticationBasicPassword string
Password for basic authentication, use if scrape job is using basic authentication method
AuthenticationBasicUsername string
Username for basic authentication, use if scrape job is using basic authentication method
AuthenticationBearerToken string
Bearer token used for authentication, use if scrape job is using bearer authentication method
Enabled bool
Whether the metrics endpoint scrape job is enabled or not.
Name string
ScrapeIntervalSeconds int
Frequency for scraping the metrics endpoint: 30, 60, or 120 seconds.
AuthenticationMethod This property is required. string
Method to pass authentication credentials: basic or bearer.
StackId This property is required. string
Url This property is required. string
The url to scrape metrics from; a valid HTTPs URL is required.
AuthenticationBasicPassword string
Password for basic authentication, use if scrape job is using basic authentication method
AuthenticationBasicUsername string
Username for basic authentication, use if scrape job is using basic authentication method
AuthenticationBearerToken string
Bearer token used for authentication, use if scrape job is using bearer authentication method
Enabled bool
Whether the metrics endpoint scrape job is enabled or not.
Name string
ScrapeIntervalSeconds int
Frequency for scraping the metrics endpoint: 30, 60, or 120 seconds.
authenticationMethod This property is required. String
Method to pass authentication credentials: basic or bearer.
stackId This property is required. String
url This property is required. String
The url to scrape metrics from; a valid HTTPs URL is required.
authenticationBasicPassword String
Password for basic authentication, use if scrape job is using basic authentication method
authenticationBasicUsername String
Username for basic authentication, use if scrape job is using basic authentication method
authenticationBearerToken String
Bearer token used for authentication, use if scrape job is using bearer authentication method
enabled Boolean
Whether the metrics endpoint scrape job is enabled or not.
name String
scrapeIntervalSeconds Integer
Frequency for scraping the metrics endpoint: 30, 60, or 120 seconds.
authenticationMethod This property is required. string
Method to pass authentication credentials: basic or bearer.
stackId This property is required. string
url This property is required. string
The url to scrape metrics from; a valid HTTPs URL is required.
authenticationBasicPassword string
Password for basic authentication, use if scrape job is using basic authentication method
authenticationBasicUsername string
Username for basic authentication, use if scrape job is using basic authentication method
authenticationBearerToken string
Bearer token used for authentication, use if scrape job is using bearer authentication method
enabled boolean
Whether the metrics endpoint scrape job is enabled or not.
name string
scrapeIntervalSeconds number
Frequency for scraping the metrics endpoint: 30, 60, or 120 seconds.
authentication_method This property is required. str
Method to pass authentication credentials: basic or bearer.
stack_id This property is required. str
url This property is required. str
The url to scrape metrics from; a valid HTTPs URL is required.
authentication_basic_password str
Password for basic authentication, use if scrape job is using basic authentication method
authentication_basic_username str
Username for basic authentication, use if scrape job is using basic authentication method
authentication_bearer_token str
Bearer token used for authentication, use if scrape job is using bearer authentication method
enabled bool
Whether the metrics endpoint scrape job is enabled or not.
name str
scrape_interval_seconds int
Frequency for scraping the metrics endpoint: 30, 60, or 120 seconds.
authenticationMethod This property is required. String
Method to pass authentication credentials: basic or bearer.
stackId This property is required. String
url This property is required. String
The url to scrape metrics from; a valid HTTPs URL is required.
authenticationBasicPassword String
Password for basic authentication, use if scrape job is using basic authentication method
authenticationBasicUsername String
Username for basic authentication, use if scrape job is using basic authentication method
authenticationBearerToken String
Bearer token used for authentication, use if scrape job is using bearer authentication method
enabled Boolean
Whether the metrics endpoint scrape job is enabled or not.
name String
scrapeIntervalSeconds Number
Frequency for scraping the metrics endpoint: 30, 60, or 120 seconds.

Outputs

All input properties are implicitly available as output properties. Additionally, the MetricsEndpointScrapeJob resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing MetricsEndpointScrapeJob Resource

Get an existing MetricsEndpointScrapeJob resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: MetricsEndpointScrapeJobState, opts?: CustomResourceOptions): MetricsEndpointScrapeJob
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        authentication_basic_password: Optional[str] = None,
        authentication_basic_username: Optional[str] = None,
        authentication_bearer_token: Optional[str] = None,
        authentication_method: Optional[str] = None,
        enabled: Optional[bool] = None,
        name: Optional[str] = None,
        scrape_interval_seconds: Optional[int] = None,
        stack_id: Optional[str] = None,
        url: Optional[str] = None) -> MetricsEndpointScrapeJob
func GetMetricsEndpointScrapeJob(ctx *Context, name string, id IDInput, state *MetricsEndpointScrapeJobState, opts ...ResourceOption) (*MetricsEndpointScrapeJob, error)
public static MetricsEndpointScrapeJob Get(string name, Input<string> id, MetricsEndpointScrapeJobState? state, CustomResourceOptions? opts = null)
public static MetricsEndpointScrapeJob get(String name, Output<String> id, MetricsEndpointScrapeJobState state, CustomResourceOptions options)
resources:  _:    type: grafana:connections:MetricsEndpointScrapeJob    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AuthenticationBasicPassword string
Password for basic authentication, use if scrape job is using basic authentication method
AuthenticationBasicUsername string
Username for basic authentication, use if scrape job is using basic authentication method
AuthenticationBearerToken string
Bearer token used for authentication, use if scrape job is using bearer authentication method
AuthenticationMethod string
Method to pass authentication credentials: basic or bearer.
Enabled bool
Whether the metrics endpoint scrape job is enabled or not.
Name string
ScrapeIntervalSeconds int
Frequency for scraping the metrics endpoint: 30, 60, or 120 seconds.
StackId string
Url string
The url to scrape metrics from; a valid HTTPs URL is required.
AuthenticationBasicPassword string
Password for basic authentication, use if scrape job is using basic authentication method
AuthenticationBasicUsername string
Username for basic authentication, use if scrape job is using basic authentication method
AuthenticationBearerToken string
Bearer token used for authentication, use if scrape job is using bearer authentication method
AuthenticationMethod string
Method to pass authentication credentials: basic or bearer.
Enabled bool
Whether the metrics endpoint scrape job is enabled or not.
Name string
ScrapeIntervalSeconds int
Frequency for scraping the metrics endpoint: 30, 60, or 120 seconds.
StackId string
Url string
The url to scrape metrics from; a valid HTTPs URL is required.
authenticationBasicPassword String
Password for basic authentication, use if scrape job is using basic authentication method
authenticationBasicUsername String
Username for basic authentication, use if scrape job is using basic authentication method
authenticationBearerToken String
Bearer token used for authentication, use if scrape job is using bearer authentication method
authenticationMethod String
Method to pass authentication credentials: basic or bearer.
enabled Boolean
Whether the metrics endpoint scrape job is enabled or not.
name String
scrapeIntervalSeconds Integer
Frequency for scraping the metrics endpoint: 30, 60, or 120 seconds.
stackId String
url String
The url to scrape metrics from; a valid HTTPs URL is required.
authenticationBasicPassword string
Password for basic authentication, use if scrape job is using basic authentication method
authenticationBasicUsername string
Username for basic authentication, use if scrape job is using basic authentication method
authenticationBearerToken string
Bearer token used for authentication, use if scrape job is using bearer authentication method
authenticationMethod string
Method to pass authentication credentials: basic or bearer.
enabled boolean
Whether the metrics endpoint scrape job is enabled or not.
name string
scrapeIntervalSeconds number
Frequency for scraping the metrics endpoint: 30, 60, or 120 seconds.
stackId string
url string
The url to scrape metrics from; a valid HTTPs URL is required.
authentication_basic_password str
Password for basic authentication, use if scrape job is using basic authentication method
authentication_basic_username str
Username for basic authentication, use if scrape job is using basic authentication method
authentication_bearer_token str
Bearer token used for authentication, use if scrape job is using bearer authentication method
authentication_method str
Method to pass authentication credentials: basic or bearer.
enabled bool
Whether the metrics endpoint scrape job is enabled or not.
name str
scrape_interval_seconds int
Frequency for scraping the metrics endpoint: 30, 60, or 120 seconds.
stack_id str
url str
The url to scrape metrics from; a valid HTTPs URL is required.
authenticationBasicPassword String
Password for basic authentication, use if scrape job is using basic authentication method
authenticationBasicUsername String
Username for basic authentication, use if scrape job is using basic authentication method
authenticationBearerToken String
Bearer token used for authentication, use if scrape job is using bearer authentication method
authenticationMethod String
Method to pass authentication credentials: basic or bearer.
enabled Boolean
Whether the metrics endpoint scrape job is enabled or not.
name String
scrapeIntervalSeconds Number
Frequency for scraping the metrics endpoint: 30, 60, or 120 seconds.
stackId String
url String
The url to scrape metrics from; a valid HTTPs URL is required.

Import

$ pulumi import grafana:connections/metricsEndpointScrapeJob:MetricsEndpointScrapeJob name "{{ stack_id }}:{{ name }}"
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
grafana pulumiverse/pulumi-grafana
License
Apache-2.0
Notes
This Pulumi package is based on the grafana Terraform Provider.