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,
});
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)
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
	})
}
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,
    });
});
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());
    }
}
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
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 string
- The unique name of the resource.
- args MetricsEndpointScrapeJobArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args 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 string
- The unique name of the resource.
- args MetricsEndpointScrapeJobArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MetricsEndpointScrapeJobArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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,
});
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),
})
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());
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)
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,
});
type: grafana:connections:MetricsEndpointScrapeJob
properties:
    authenticationBasicPassword: string
    authenticationBasicUsername: string
    authenticationBearerToken: string
    authenticationMethod: string
    enabled: false
    name: string
    scrapeIntervalSeconds: 0
    stackId: string
    url: string
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 string
- Method to pass authentication credentials: basic or bearer.
- StackId string
- Url string
- The url to scrape metrics from; a valid HTTPs URL is required.
- AuthenticationBasic stringPassword 
- Password for basic authentication, use if scrape job is using basic authentication method
- AuthenticationBasic stringUsername 
- Username for basic authentication, use if scrape job is using basic authentication method
- AuthenticationBearer stringToken 
- 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
- ScrapeInterval intSeconds 
- Frequency for scraping the metrics endpoint: 30, 60, or 120 seconds.
- AuthenticationMethod string
- Method to pass authentication credentials: basic or bearer.
- StackId string
- Url string
- The url to scrape metrics from; a valid HTTPs URL is required.
- AuthenticationBasic stringPassword 
- Password for basic authentication, use if scrape job is using basic authentication method
- AuthenticationBasic stringUsername 
- Username for basic authentication, use if scrape job is using basic authentication method
- AuthenticationBearer stringToken 
- 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
- ScrapeInterval intSeconds 
- Frequency for scraping the metrics endpoint: 30, 60, or 120 seconds.
- authenticationMethod String
- Method to pass authentication credentials: basic or bearer.
- stackId String
- url String
- The url to scrape metrics from; a valid HTTPs URL is required.
- authenticationBasic StringPassword 
- Password for basic authentication, use if scrape job is using basic authentication method
- authenticationBasic StringUsername 
- Username for basic authentication, use if scrape job is using basic authentication method
- authenticationBearer StringToken 
- 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
- scrapeInterval IntegerSeconds 
- Frequency for scraping the metrics endpoint: 30, 60, or 120 seconds.
- authenticationMethod string
- Method to pass authentication credentials: basic or bearer.
- stackId string
- url string
- The url to scrape metrics from; a valid HTTPs URL is required.
- authenticationBasic stringPassword 
- Password for basic authentication, use if scrape job is using basic authentication method
- authenticationBasic stringUsername 
- Username for basic authentication, use if scrape job is using basic authentication method
- authenticationBearer stringToken 
- 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
- scrapeInterval numberSeconds 
- Frequency for scraping the metrics endpoint: 30, 60, or 120 seconds.
- authentication_method str
- Method to pass authentication credentials: basic or bearer.
- stack_id str
- url str
- The url to scrape metrics from; a valid HTTPs URL is required.
- authentication_basic_ strpassword 
- Password for basic authentication, use if scrape job is using basic authentication method
- authentication_basic_ strusername 
- Username for basic authentication, use if scrape job is using basic authentication method
- authentication_bearer_ strtoken 
- 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_ intseconds 
- Frequency for scraping the metrics endpoint: 30, 60, or 120 seconds.
- authenticationMethod String
- Method to pass authentication credentials: basic or bearer.
- stackId String
- url String
- The url to scrape metrics from; a valid HTTPs URL is required.
- authenticationBasic StringPassword 
- Password for basic authentication, use if scrape job is using basic authentication method
- authenticationBasic StringUsername 
- Username for basic authentication, use if scrape job is using basic authentication method
- authenticationBearer StringToken 
- 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
- scrapeInterval NumberSeconds 
- 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) -> MetricsEndpointScrapeJobfunc 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- AuthenticationBasic stringPassword 
- Password for basic authentication, use if scrape job is using basic authentication method
- AuthenticationBasic stringUsername 
- Username for basic authentication, use if scrape job is using basic authentication method
- AuthenticationBearer stringToken 
- 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
- ScrapeInterval intSeconds 
- 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.
- AuthenticationBasic stringPassword 
- Password for basic authentication, use if scrape job is using basic authentication method
- AuthenticationBasic stringUsername 
- Username for basic authentication, use if scrape job is using basic authentication method
- AuthenticationBearer stringToken 
- 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
- ScrapeInterval intSeconds 
- 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.
- authenticationBasic StringPassword 
- Password for basic authentication, use if scrape job is using basic authentication method
- authenticationBasic StringUsername 
- Username for basic authentication, use if scrape job is using basic authentication method
- authenticationBearer StringToken 
- 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
- scrapeInterval IntegerSeconds 
- 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.
- authenticationBasic stringPassword 
- Password for basic authentication, use if scrape job is using basic authentication method
- authenticationBasic stringUsername 
- Username for basic authentication, use if scrape job is using basic authentication method
- authenticationBearer stringToken 
- 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
- scrapeInterval numberSeconds 
- 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_ strpassword 
- Password for basic authentication, use if scrape job is using basic authentication method
- authentication_basic_ strusername 
- Username for basic authentication, use if scrape job is using basic authentication method
- authentication_bearer_ strtoken 
- 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_ intseconds 
- 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.
- authenticationBasic StringPassword 
- Password for basic authentication, use if scrape job is using basic authentication method
- authenticationBasic StringUsername 
- Username for basic authentication, use if scrape job is using basic authentication method
- authenticationBearer StringToken 
- 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
- scrapeInterval NumberSeconds 
- 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 }}"
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 grafanaTerraform Provider.
