grafana.machineLearning.Job
Explore with Pulumi AI
A job defines the queries and model parameters for a machine learning task.
Create Job Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Job(name: string, args: JobArgs, opts?: CustomResourceOptions);
@overload
def Job(resource_name: str,
args: JobArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Job(resource_name: str,
opts: Optional[ResourceOptions] = None,
datasource_type: Optional[str] = None,
datasource_uid: Optional[str] = None,
metric: Optional[str] = None,
query_params: Optional[Mapping[str, str]] = None,
custom_labels: Optional[Mapping[str, str]] = None,
description: Optional[str] = None,
holidays: Optional[Sequence[str]] = None,
hyper_params: Optional[Mapping[str, str]] = None,
interval: Optional[int] = None,
name: Optional[str] = None,
training_window: Optional[int] = None)
func NewJob(ctx *Context, name string, args JobArgs, opts ...ResourceOption) (*Job, error)
public Job(string name, JobArgs args, CustomResourceOptions? opts = null)
type: grafana:machineLearning:Job
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 JobArgs
- 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 JobArgs
- 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 JobArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args JobArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args JobArgs
- 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 jobResource = new Grafana.MachineLearning.Job("jobResource", new()
{
DatasourceType = "string",
DatasourceUid = "string",
Metric = "string",
QueryParams =
{
{ "string", "string" },
},
CustomLabels =
{
{ "string", "string" },
},
Description = "string",
Holidays = new[]
{
"string",
},
HyperParams =
{
{ "string", "string" },
},
Interval = 0,
Name = "string",
TrainingWindow = 0,
});
example, err := machineLearning.NewJob(ctx, "jobResource", &machineLearning.JobArgs{
DatasourceType: pulumi.String("string"),
DatasourceUid: pulumi.String("string"),
Metric: pulumi.String("string"),
QueryParams: pulumi.StringMap{
"string": pulumi.String("string"),
},
CustomLabels: pulumi.StringMap{
"string": pulumi.String("string"),
},
Description: pulumi.String("string"),
Holidays: pulumi.StringArray{
pulumi.String("string"),
},
HyperParams: pulumi.StringMap{
"string": pulumi.String("string"),
},
Interval: pulumi.Int(0),
Name: pulumi.String("string"),
TrainingWindow: pulumi.Int(0),
})
var jobResource = new Job("jobResource", JobArgs.builder()
.datasourceType("string")
.datasourceUid("string")
.metric("string")
.queryParams(Map.of("string", "string"))
.customLabels(Map.of("string", "string"))
.description("string")
.holidays("string")
.hyperParams(Map.of("string", "string"))
.interval(0)
.name("string")
.trainingWindow(0)
.build());
job_resource = grafana.machine_learning.Job("jobResource",
datasource_type="string",
datasource_uid="string",
metric="string",
query_params={
"string": "string",
},
custom_labels={
"string": "string",
},
description="string",
holidays=["string"],
hyper_params={
"string": "string",
},
interval=0,
name="string",
training_window=0)
const jobResource = new grafana.machinelearning.Job("jobResource", {
datasourceType: "string",
datasourceUid: "string",
metric: "string",
queryParams: {
string: "string",
},
customLabels: {
string: "string",
},
description: "string",
holidays: ["string"],
hyperParams: {
string: "string",
},
interval: 0,
name: "string",
trainingWindow: 0,
});
type: grafana:machineLearning:Job
properties:
customLabels:
string: string
datasourceType: string
datasourceUid: string
description: string
holidays:
- string
hyperParams:
string: string
interval: 0
metric: string
name: string
queryParams:
string: string
trainingWindow: 0
Job 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 Job resource accepts the following input properties:
- Datasource
Type string - The type of datasource being queried. Currently allowed values are prometheus, graphite, loki, postgres, and datadog.
- Datasource
Uid string - The uid of the datasource to query.
- Metric string
- The metric used to query the job results.
- Query
Params Dictionary<string, string> - An object representing the query params to query Grafana with.
- Custom
Labels Dictionary<string, string> - An object representing the custom labels added on the forecast.
- Description string
- A description of the job.
- Holidays List<string>
- A list of holiday IDs or names to take into account when training the model.
- Hyper
Params Dictionary<string, string> - The hyperparameters used to fine tune the algorithm. See https://grafana.com/docs/grafana-cloud/machine-learning/models/ for the full list of available hyperparameters. Defaults to
map[]
. - Interval int
- The data interval in seconds to train the data on. Defaults to
300
. - Name string
- The name of the job.
- Training
Window int - The data interval in seconds to train the data on. Defaults to
7776000
.
- Datasource
Type string - The type of datasource being queried. Currently allowed values are prometheus, graphite, loki, postgres, and datadog.
- Datasource
Uid string - The uid of the datasource to query.
- Metric string
- The metric used to query the job results.
- Query
Params map[string]string - An object representing the query params to query Grafana with.
- Custom
Labels map[string]string - An object representing the custom labels added on the forecast.
- Description string
- A description of the job.
- Holidays []string
- A list of holiday IDs or names to take into account when training the model.
- Hyper
Params map[string]string - The hyperparameters used to fine tune the algorithm. See https://grafana.com/docs/grafana-cloud/machine-learning/models/ for the full list of available hyperparameters. Defaults to
map[]
. - Interval int
- The data interval in seconds to train the data on. Defaults to
300
. - Name string
- The name of the job.
- Training
Window int - The data interval in seconds to train the data on. Defaults to
7776000
.
- datasource
Type String - The type of datasource being queried. Currently allowed values are prometheus, graphite, loki, postgres, and datadog.
- datasource
Uid String - The uid of the datasource to query.
- metric String
- The metric used to query the job results.
- query
Params Map<String,String> - An object representing the query params to query Grafana with.
- custom
Labels Map<String,String> - An object representing the custom labels added on the forecast.
- description String
- A description of the job.
- holidays List<String>
- A list of holiday IDs or names to take into account when training the model.
- hyper
Params Map<String,String> - The hyperparameters used to fine tune the algorithm. See https://grafana.com/docs/grafana-cloud/machine-learning/models/ for the full list of available hyperparameters. Defaults to
map[]
. - interval Integer
- The data interval in seconds to train the data on. Defaults to
300
. - name String
- The name of the job.
- training
Window Integer - The data interval in seconds to train the data on. Defaults to
7776000
.
- datasource
Type string - The type of datasource being queried. Currently allowed values are prometheus, graphite, loki, postgres, and datadog.
- datasource
Uid string - The uid of the datasource to query.
- metric string
- The metric used to query the job results.
- query
Params {[key: string]: string} - An object representing the query params to query Grafana with.
- custom
Labels {[key: string]: string} - An object representing the custom labels added on the forecast.
- description string
- A description of the job.
- holidays string[]
- A list of holiday IDs or names to take into account when training the model.
- hyper
Params {[key: string]: string} - The hyperparameters used to fine tune the algorithm. See https://grafana.com/docs/grafana-cloud/machine-learning/models/ for the full list of available hyperparameters. Defaults to
map[]
. - interval number
- The data interval in seconds to train the data on. Defaults to
300
. - name string
- The name of the job.
- training
Window number - The data interval in seconds to train the data on. Defaults to
7776000
.
- datasource_
type str - The type of datasource being queried. Currently allowed values are prometheus, graphite, loki, postgres, and datadog.
- datasource_
uid str - The uid of the datasource to query.
- metric str
- The metric used to query the job results.
- query_
params Mapping[str, str] - An object representing the query params to query Grafana with.
- custom_
labels Mapping[str, str] - An object representing the custom labels added on the forecast.
- description str
- A description of the job.
- holidays Sequence[str]
- A list of holiday IDs or names to take into account when training the model.
- hyper_
params Mapping[str, str] - The hyperparameters used to fine tune the algorithm. See https://grafana.com/docs/grafana-cloud/machine-learning/models/ for the full list of available hyperparameters. Defaults to
map[]
. - interval int
- The data interval in seconds to train the data on. Defaults to
300
. - name str
- The name of the job.
- training_
window int - The data interval in seconds to train the data on. Defaults to
7776000
.
- datasource
Type String - The type of datasource being queried. Currently allowed values are prometheus, graphite, loki, postgres, and datadog.
- datasource
Uid String - The uid of the datasource to query.
- metric String
- The metric used to query the job results.
- query
Params Map<String> - An object representing the query params to query Grafana with.
- custom
Labels Map<String> - An object representing the custom labels added on the forecast.
- description String
- A description of the job.
- holidays List<String>
- A list of holiday IDs or names to take into account when training the model.
- hyper
Params Map<String> - The hyperparameters used to fine tune the algorithm. See https://grafana.com/docs/grafana-cloud/machine-learning/models/ for the full list of available hyperparameters. Defaults to
map[]
. - interval Number
- The data interval in seconds to train the data on. Defaults to
300
. - name String
- The name of the job.
- training
Window Number - The data interval in seconds to train the data on. Defaults to
7776000
.
Outputs
All input properties are implicitly available as output properties. Additionally, the Job 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 Job Resource
Get an existing Job 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?: JobState, opts?: CustomResourceOptions): Job
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
custom_labels: Optional[Mapping[str, str]] = None,
datasource_type: Optional[str] = None,
datasource_uid: Optional[str] = None,
description: Optional[str] = None,
holidays: Optional[Sequence[str]] = None,
hyper_params: Optional[Mapping[str, str]] = None,
interval: Optional[int] = None,
metric: Optional[str] = None,
name: Optional[str] = None,
query_params: Optional[Mapping[str, str]] = None,
training_window: Optional[int] = None) -> Job
func GetJob(ctx *Context, name string, id IDInput, state *JobState, opts ...ResourceOption) (*Job, error)
public static Job Get(string name, Input<string> id, JobState? state, CustomResourceOptions? opts = null)
public static Job get(String name, Output<String> id, JobState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Custom
Labels Dictionary<string, string> - An object representing the custom labels added on the forecast.
- Datasource
Type string - The type of datasource being queried. Currently allowed values are prometheus, graphite, loki, postgres, and datadog.
- Datasource
Uid string - The uid of the datasource to query.
- Description string
- A description of the job.
- Holidays List<string>
- A list of holiday IDs or names to take into account when training the model.
- Hyper
Params Dictionary<string, string> - The hyperparameters used to fine tune the algorithm. See https://grafana.com/docs/grafana-cloud/machine-learning/models/ for the full list of available hyperparameters. Defaults to
map[]
. - Interval int
- The data interval in seconds to train the data on. Defaults to
300
. - Metric string
- The metric used to query the job results.
- Name string
- The name of the job.
- Query
Params Dictionary<string, string> - An object representing the query params to query Grafana with.
- Training
Window int - The data interval in seconds to train the data on. Defaults to
7776000
.
- Custom
Labels map[string]string - An object representing the custom labels added on the forecast.
- Datasource
Type string - The type of datasource being queried. Currently allowed values are prometheus, graphite, loki, postgres, and datadog.
- Datasource
Uid string - The uid of the datasource to query.
- Description string
- A description of the job.
- Holidays []string
- A list of holiday IDs or names to take into account when training the model.
- Hyper
Params map[string]string - The hyperparameters used to fine tune the algorithm. See https://grafana.com/docs/grafana-cloud/machine-learning/models/ for the full list of available hyperparameters. Defaults to
map[]
. - Interval int
- The data interval in seconds to train the data on. Defaults to
300
. - Metric string
- The metric used to query the job results.
- Name string
- The name of the job.
- Query
Params map[string]string - An object representing the query params to query Grafana with.
- Training
Window int - The data interval in seconds to train the data on. Defaults to
7776000
.
- custom
Labels Map<String,String> - An object representing the custom labels added on the forecast.
- datasource
Type String - The type of datasource being queried. Currently allowed values are prometheus, graphite, loki, postgres, and datadog.
- datasource
Uid String - The uid of the datasource to query.
- description String
- A description of the job.
- holidays List<String>
- A list of holiday IDs or names to take into account when training the model.
- hyper
Params Map<String,String> - The hyperparameters used to fine tune the algorithm. See https://grafana.com/docs/grafana-cloud/machine-learning/models/ for the full list of available hyperparameters. Defaults to
map[]
. - interval Integer
- The data interval in seconds to train the data on. Defaults to
300
. - metric String
- The metric used to query the job results.
- name String
- The name of the job.
- query
Params Map<String,String> - An object representing the query params to query Grafana with.
- training
Window Integer - The data interval in seconds to train the data on. Defaults to
7776000
.
- custom
Labels {[key: string]: string} - An object representing the custom labels added on the forecast.
- datasource
Type string - The type of datasource being queried. Currently allowed values are prometheus, graphite, loki, postgres, and datadog.
- datasource
Uid string - The uid of the datasource to query.
- description string
- A description of the job.
- holidays string[]
- A list of holiday IDs or names to take into account when training the model.
- hyper
Params {[key: string]: string} - The hyperparameters used to fine tune the algorithm. See https://grafana.com/docs/grafana-cloud/machine-learning/models/ for the full list of available hyperparameters. Defaults to
map[]
. - interval number
- The data interval in seconds to train the data on. Defaults to
300
. - metric string
- The metric used to query the job results.
- name string
- The name of the job.
- query
Params {[key: string]: string} - An object representing the query params to query Grafana with.
- training
Window number - The data interval in seconds to train the data on. Defaults to
7776000
.
- custom_
labels Mapping[str, str] - An object representing the custom labels added on the forecast.
- datasource_
type str - The type of datasource being queried. Currently allowed values are prometheus, graphite, loki, postgres, and datadog.
- datasource_
uid str - The uid of the datasource to query.
- description str
- A description of the job.
- holidays Sequence[str]
- A list of holiday IDs or names to take into account when training the model.
- hyper_
params Mapping[str, str] - The hyperparameters used to fine tune the algorithm. See https://grafana.com/docs/grafana-cloud/machine-learning/models/ for the full list of available hyperparameters. Defaults to
map[]
. - interval int
- The data interval in seconds to train the data on. Defaults to
300
. - metric str
- The metric used to query the job results.
- name str
- The name of the job.
- query_
params Mapping[str, str] - An object representing the query params to query Grafana with.
- training_
window int - The data interval in seconds to train the data on. Defaults to
7776000
.
- custom
Labels Map<String> - An object representing the custom labels added on the forecast.
- datasource
Type String - The type of datasource being queried. Currently allowed values are prometheus, graphite, loki, postgres, and datadog.
- datasource
Uid String - The uid of the datasource to query.
- description String
- A description of the job.
- holidays List<String>
- A list of holiday IDs or names to take into account when training the model.
- hyper
Params Map<String> - The hyperparameters used to fine tune the algorithm. See https://grafana.com/docs/grafana-cloud/machine-learning/models/ for the full list of available hyperparameters. Defaults to
map[]
. - interval Number
- The data interval in seconds to train the data on. Defaults to
300
. - metric String
- The metric used to query the job results.
- name String
- The name of the job.
- query
Params Map<String> - An object representing the query params to query Grafana with.
- training
Window Number - The data interval in seconds to train the data on. Defaults to
7776000
.
Import
$ pulumi import grafana:machineLearning/job:Job name "{{ id }}"
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.