grafana.MachineLearningJob
Explore with Pulumi AI
A job defines the queries and model parameters for a machine learning task.
Create MachineLearningJob Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MachineLearningJob(name: string, args: MachineLearningJobArgs, opts?: CustomResourceOptions);
@overload
def MachineLearningJob(resource_name: str,
args: MachineLearningJobArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MachineLearningJob(resource_name: str,
opts: Optional[ResourceOptions] = None,
datasource_type: Optional[str] = None,
metric: Optional[str] = None,
query_params: Optional[Mapping[str, Any]] = None,
custom_labels: Optional[Mapping[str, Any]] = None,
datasource_id: Optional[int] = None,
datasource_uid: Optional[str] = None,
description: Optional[str] = None,
holidays: Optional[Sequence[str]] = None,
hyper_params: Optional[Mapping[str, Any]] = None,
interval: Optional[int] = None,
name: Optional[str] = None,
training_window: Optional[int] = None)
func NewMachineLearningJob(ctx *Context, name string, args MachineLearningJobArgs, opts ...ResourceOption) (*MachineLearningJob, error)
public MachineLearningJob(string name, MachineLearningJobArgs args, CustomResourceOptions? opts = null)
public MachineLearningJob(String name, MachineLearningJobArgs args)
public MachineLearningJob(String name, MachineLearningJobArgs args, CustomResourceOptions options)
type: grafana:MachineLearningJob
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 MachineLearningJobArgs
- 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 MachineLearningJobArgs
- 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 MachineLearningJobArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MachineLearningJobArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MachineLearningJobArgs
- 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 machineLearningJobResource = new Grafana.MachineLearningJob("machineLearningJobResource", new()
{
DatasourceType = "string",
Metric = "string",
QueryParams =
{
{ "string", "any" },
},
CustomLabels =
{
{ "string", "any" },
},
DatasourceUid = "string",
Description = "string",
Holidays = new[]
{
"string",
},
HyperParams =
{
{ "string", "any" },
},
Interval = 0,
Name = "string",
TrainingWindow = 0,
});
example, err := grafana.NewMachineLearningJob(ctx, "machineLearningJobResource", &grafana.MachineLearningJobArgs{
DatasourceType: pulumi.String("string"),
Metric: pulumi.String("string"),
QueryParams: pulumi.Map{
"string": pulumi.Any("any"),
},
CustomLabels: pulumi.Map{
"string": pulumi.Any("any"),
},
DatasourceUid: pulumi.String("string"),
Description: pulumi.String("string"),
Holidays: pulumi.StringArray{
pulumi.String("string"),
},
HyperParams: pulumi.Map{
"string": pulumi.Any("any"),
},
Interval: pulumi.Int(0),
Name: pulumi.String("string"),
TrainingWindow: pulumi.Int(0),
})
var machineLearningJobResource = new MachineLearningJob("machineLearningJobResource", MachineLearningJobArgs.builder()
.datasourceType("string")
.metric("string")
.queryParams(Map.of("string", "any"))
.customLabels(Map.of("string", "any"))
.datasourceUid("string")
.description("string")
.holidays("string")
.hyperParams(Map.of("string", "any"))
.interval(0)
.name("string")
.trainingWindow(0)
.build());
machine_learning_job_resource = grafana.MachineLearningJob("machineLearningJobResource",
datasource_type="string",
metric="string",
query_params={
"string": "any",
},
custom_labels={
"string": "any",
},
datasource_uid="string",
description="string",
holidays=["string"],
hyper_params={
"string": "any",
},
interval=0,
name="string",
training_window=0)
const machineLearningJobResource = new grafana.MachineLearningJob("machineLearningJobResource", {
datasourceType: "string",
metric: "string",
queryParams: {
string: "any",
},
customLabels: {
string: "any",
},
datasourceUid: "string",
description: "string",
holidays: ["string"],
hyperParams: {
string: "any",
},
interval: 0,
name: "string",
trainingWindow: 0,
});
type: grafana:MachineLearningJob
properties:
customLabels:
string: any
datasourceType: string
datasourceUid: string
description: string
holidays:
- string
hyperParams:
string: any
interval: 0
metric: string
name: string
queryParams:
string: any
trainingWindow: 0
MachineLearningJob Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The MachineLearningJob 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.
- Metric string
- The metric used to query the job results.
- Query
Params Dictionary<string, object> - An object representing the query params to query Grafana with.
- Custom
Labels Dictionary<string, object> - An object representing the custom labels added on the forecast.
- Datasource
Id int - The id of the datasource to query.
- 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, object> - 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.
- Metric string
- The metric used to query the job results.
- Query
Params map[string]interface{} - An object representing the query params to query Grafana with.
- Custom
Labels map[string]interface{} - An object representing the custom labels added on the forecast.
- Datasource
Id int - The id of the datasource to query.
- 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]interface{} - 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.
- metric String
- The metric used to query the job results.
- query
Params Map<String,Object> - An object representing the query params to query Grafana with.
- custom
Labels Map<String,Object> - An object representing the custom labels added on the forecast.
- datasource
Id Integer - The id of the datasource to query.
- 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,Object> - 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.
- metric string
- The metric used to query the job results.
- query
Params {[key: string]: any} - An object representing the query params to query Grafana with.
- custom
Labels {[key: string]: any} - An object representing the custom labels added on the forecast.
- datasource
Id number - The id of the datasource to query.
- 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]: any} - 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.
- metric str
- The metric used to query the job results.
- query_
params Mapping[str, Any] - An object representing the query params to query Grafana with.
- custom_
labels Mapping[str, Any] - An object representing the custom labels added on the forecast.
- datasource_
id int - The id of the datasource to query.
- 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, Any] - 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.
- metric String
- The metric used to query the job results.
- query
Params Map<Any> - An object representing the query params to query Grafana with.
- custom
Labels Map<Any> - An object representing the custom labels added on the forecast.
- datasource
Id Number - The id of the datasource to query.
- 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<Any> - 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 MachineLearningJob 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 MachineLearningJob Resource
Get an existing MachineLearningJob 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?: MachineLearningJobState, opts?: CustomResourceOptions): MachineLearningJob
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
custom_labels: Optional[Mapping[str, Any]] = None,
datasource_id: Optional[int] = 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, Any]] = None,
interval: Optional[int] = None,
metric: Optional[str] = None,
name: Optional[str] = None,
query_params: Optional[Mapping[str, Any]] = None,
training_window: Optional[int] = None) -> MachineLearningJob
func GetMachineLearningJob(ctx *Context, name string, id IDInput, state *MachineLearningJobState, opts ...ResourceOption) (*MachineLearningJob, error)
public static MachineLearningJob Get(string name, Input<string> id, MachineLearningJobState? state, CustomResourceOptions? opts = null)
public static MachineLearningJob get(String name, Output<String> id, MachineLearningJobState 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, object> - An object representing the custom labels added on the forecast.
- Datasource
Id int - The id of the datasource to query.
- 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, object> - 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, object> - 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]interface{} - An object representing the custom labels added on the forecast.
- Datasource
Id int - The id of the datasource to query.
- 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]interface{} - 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]interface{} - 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,Object> - An object representing the custom labels added on the forecast.
- datasource
Id Integer - The id of the datasource to query.
- 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,Object> - 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,Object> - 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]: any} - An object representing the custom labels added on the forecast.
- datasource
Id number - The id of the datasource to query.
- 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]: any} - 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]: any} - 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, Any] - An object representing the custom labels added on the forecast.
- datasource_
id int - The id of the datasource to query.
- 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, Any] - 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, Any] - 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<Any> - An object representing the custom labels added on the forecast.
- datasource
Id Number - The id of the datasource to query.
- 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<Any> - 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<Any> - 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:index/machineLearningJob:MachineLearningJob 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.