From cb3fda5de0611df36e649b19107c247ad4da175e Mon Sep 17 00:00:00 2001 From: Ringo De Smet Date: Wed, 30 Oct 2024 11:22:03 +0100 Subject: [PATCH] Convert Python SDK to `pyproject.toml` setup --- Makefile | 17 +- .../cmd/pulumi-resource-grafana/schema.json | 4 +- provider/resources.go | 1 + sdk/python/go.mod | 3 + sdk/python/pulumiverse_grafana/api_key.py | 296 ------------- .../pulumiverse_grafana/cloud/api_key.py | 325 -------------- .../cloud/stack_api_key.py | 278 ------------ .../pulumiverse_grafana/cloud_api_key.py | 284 ------------ .../cloud_stack_api_key.py | 284 ------------ .../pulumiverse_grafana/get_oncall_action.py | 81 ---- .../pulumiverse_grafana/oncall/get_action.py | 92 ---- .../organization_preference.py | 406 ------------------ sdk/python/pulumiverse_grafana/oss/api_key.py | 316 -------------- sdk/python/pyproject.toml | 22 + sdk/python/setup.py | 44 -- 15 files changed, 39 insertions(+), 2414 deletions(-) create mode 100644 sdk/python/go.mod delete mode 100644 sdk/python/pulumiverse_grafana/api_key.py delete mode 100644 sdk/python/pulumiverse_grafana/cloud/api_key.py delete mode 100644 sdk/python/pulumiverse_grafana/cloud/stack_api_key.py delete mode 100644 sdk/python/pulumiverse_grafana/cloud_api_key.py delete mode 100644 sdk/python/pulumiverse_grafana/cloud_stack_api_key.py delete mode 100644 sdk/python/pulumiverse_grafana/get_oncall_action.py delete mode 100644 sdk/python/pulumiverse_grafana/oncall/get_action.py delete mode 100644 sdk/python/pulumiverse_grafana/organization_preference.py delete mode 100644 sdk/python/pulumiverse_grafana/oss/api_key.py create mode 100644 sdk/python/pyproject.toml delete mode 100644 sdk/python/setup.py diff --git a/Makefile b/Makefile index d6ca3ee2..a8b213fb 100644 --- a/Makefile +++ b/Makefile @@ -46,14 +46,17 @@ build_nodejs:: install_plugins tfgen # build the node sdk build_python:: PYPI_VERSION := $(shell pulumictl get version --language python) build_python:: install_plugins tfgen # build the python sdk - $(WORKING_DIR)/bin/$(TFGEN) python --overlays provider/overlays/python --out sdk/python/ + rm -rf sdk/python/ + PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ cd sdk/python/ && \ - cp ../../README.md . && \ - python3 setup.py clean --all 2>/dev/null && \ - rm -rf ./bin/ ../python.bin/ && cp -R . ../python.bin && mv ../python.bin ./bin && \ - sed -i.bak -e 's/^VERSION = .*/VERSION = "$(PYPI_VERSION)"/g' -e 's/^PLUGIN_VERSION = .*/PLUGIN_VERSION = "$(VERSION)"/g' ./bin/setup.py && \ - rm ./bin/setup.py.bak && \ - cd ./bin && python3 setup.py build sdist + printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ + cp ../../README.md . && \ + rm -rf ./bin/ ../python.bin/ && cp -R . ../python.bin && mv ../python.bin ./bin && \ + rm ./bin/go.mod && \ + python3 -m venv venv && \ + ./venv/bin/python -m pip install build==1.2.1 && \ + cd ./bin && \ + ../venv/bin/python -m build . build_go:: install_plugins tfgen # build the go sdk $(WORKING_DIR)/bin/$(TFGEN) go --overlays provider/overlays/go --out sdk/go/ diff --git a/provider/cmd/pulumi-resource-grafana/schema.json b/provider/cmd/pulumi-resource-grafana/schema.json index 7cea1aa0..7d55567c 100644 --- a/provider/cmd/pulumi-resource-grafana/schema.json +++ b/provider/cmd/pulumi-resource-grafana/schema.json @@ -51,7 +51,9 @@ }, "readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/grafana/terraform-provider-grafana)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-grafana` repo](https://github.com/pulumiverse/pulumi-grafana/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-grafana` repo](https://github.com/grafana/terraform-provider-grafana/issues).", "compatibility": "tfbridge20", - "pyproject": {} + "pyproject": { + "enabled": true + } } }, "config": { diff --git a/provider/resources.go b/provider/resources.go index 9298c327..b90d0da4 100644 --- a/provider/resources.go +++ b/provider/resources.go @@ -1010,6 +1010,7 @@ func Provider() tfbridge.ProviderInfo { Requires: map[string]string{ "pulumi": ">=3.0.0,<4.0.0", }, + PyProject: struct{ Enabled bool }{true}, }, Golang: &tfbridge.GolangInfo{ ImportBasePath: filepath.Join( diff --git a/sdk/python/go.mod b/sdk/python/go.mod new file mode 100644 index 00000000..b91fcbc3 --- /dev/null +++ b/sdk/python/go.mod @@ -0,0 +1,3 @@ +module fake_python_module // Exclude this directory from Go tools + +go 1.17 diff --git a/sdk/python/pulumiverse_grafana/api_key.py b/sdk/python/pulumiverse_grafana/api_key.py deleted file mode 100644 index 5ed8cf33..00000000 --- a/sdk/python/pulumiverse_grafana/api_key.py +++ /dev/null @@ -1,296 +0,0 @@ -# coding=utf-8 -# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** -# *** Do not edit by hand unless you're certain you know what you are doing! *** - -import copy -import warnings -import pulumi -import pulumi.runtime -from typing import Any, Mapping, Optional, Sequence, Union, overload -from . import _utilities - -__all__ = ['ApiKeyArgs', 'ApiKey'] - -@pulumi.input_type -class ApiKeyArgs: - def __init__(__self__, *, - role: pulumi.Input[str], - name: Optional[pulumi.Input[str]] = None, - org_id: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None): - """ - The set of arguments for constructing a ApiKey resource. - :param pulumi.Input[str] org_id: The Organization ID. If not set, the Org ID defined in the provider block will be used. - """ - pulumi.set(__self__, "role", role) - if name is not None: - pulumi.set(__self__, "name", name) - if org_id is not None: - pulumi.set(__self__, "org_id", org_id) - if seconds_to_live is not None: - pulumi.set(__self__, "seconds_to_live", seconds_to_live) - - @property - @pulumi.getter - def role(self) -> pulumi.Input[str]: - return pulumi.get(self, "role") - - @role.setter - def role(self, value: pulumi.Input[str]): - pulumi.set(self, "role", value) - - @property - @pulumi.getter - def name(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "name") - - @name.setter - def name(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "name", value) - - @property - @pulumi.getter(name="orgId") - def org_id(self) -> Optional[pulumi.Input[str]]: - """ - The Organization ID. If not set, the Org ID defined in the provider block will be used. - """ - return pulumi.get(self, "org_id") - - @org_id.setter - def org_id(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "org_id", value) - - @property - @pulumi.getter(name="secondsToLive") - def seconds_to_live(self) -> Optional[pulumi.Input[int]]: - return pulumi.get(self, "seconds_to_live") - - @seconds_to_live.setter - def seconds_to_live(self, value: Optional[pulumi.Input[int]]): - pulumi.set(self, "seconds_to_live", value) - - -@pulumi.input_type -class _ApiKeyState: - def __init__(__self__, *, - expiration: Optional[pulumi.Input[str]] = None, - key: Optional[pulumi.Input[str]] = None, - name: Optional[pulumi.Input[str]] = None, - org_id: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None): - """ - Input properties used for looking up and filtering ApiKey resources. - :param pulumi.Input[str] org_id: The Organization ID. If not set, the Org ID defined in the provider block will be used. - """ - if expiration is not None: - pulumi.set(__self__, "expiration", expiration) - if key is not None: - pulumi.set(__self__, "key", key) - if name is not None: - pulumi.set(__self__, "name", name) - if org_id is not None: - pulumi.set(__self__, "org_id", org_id) - if role is not None: - pulumi.set(__self__, "role", role) - if seconds_to_live is not None: - pulumi.set(__self__, "seconds_to_live", seconds_to_live) - - @property - @pulumi.getter - def expiration(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "expiration") - - @expiration.setter - def expiration(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "expiration", value) - - @property - @pulumi.getter - def key(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "key") - - @key.setter - def key(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "key", value) - - @property - @pulumi.getter - def name(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "name") - - @name.setter - def name(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "name", value) - - @property - @pulumi.getter(name="orgId") - def org_id(self) -> Optional[pulumi.Input[str]]: - """ - The Organization ID. If not set, the Org ID defined in the provider block will be used. - """ - return pulumi.get(self, "org_id") - - @org_id.setter - def org_id(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "org_id", value) - - @property - @pulumi.getter - def role(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "role") - - @role.setter - def role(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "role", value) - - @property - @pulumi.getter(name="secondsToLive") - def seconds_to_live(self) -> Optional[pulumi.Input[int]]: - return pulumi.get(self, "seconds_to_live") - - @seconds_to_live.setter - def seconds_to_live(self, value: Optional[pulumi.Input[int]]): - pulumi.set(self, "seconds_to_live", value) - - -warnings.warn("""grafana.index/apikey.ApiKey has been deprecated in favor of grafana.oss/apikey.ApiKey""", DeprecationWarning) - - -class ApiKey(pulumi.CustomResource): - warnings.warn("""grafana.index/apikey.ApiKey has been deprecated in favor of grafana.oss/apikey.ApiKey""", DeprecationWarning) - - @overload - def __init__(__self__, - resource_name: str, - opts: Optional[pulumi.ResourceOptions] = None, - name: Optional[pulumi.Input[str]] = None, - org_id: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None, - __props__=None): - """ - Create a ApiKey resource with the given unique name, props, and options. - :param str resource_name: The name of the resource. - :param pulumi.ResourceOptions opts: Options for the resource. - :param pulumi.Input[str] org_id: The Organization ID. If not set, the Org ID defined in the provider block will be used. - """ - ... - @overload - def __init__(__self__, - resource_name: str, - args: ApiKeyArgs, - opts: Optional[pulumi.ResourceOptions] = None): - """ - Create a ApiKey resource with the given unique name, props, and options. - :param str resource_name: The name of the resource. - :param ApiKeyArgs args: The arguments to use to populate this resource's properties. - :param pulumi.ResourceOptions opts: Options for the resource. - """ - ... - def __init__(__self__, resource_name: str, *args, **kwargs): - resource_args, opts = _utilities.get_resource_args_opts(ApiKeyArgs, pulumi.ResourceOptions, *args, **kwargs) - if resource_args is not None: - __self__._internal_init(resource_name, opts, **resource_args.__dict__) - else: - __self__._internal_init(resource_name, *args, **kwargs) - - def _internal_init(__self__, - resource_name: str, - opts: Optional[pulumi.ResourceOptions] = None, - name: Optional[pulumi.Input[str]] = None, - org_id: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None, - __props__=None): - pulumi.log.warn("""ApiKey is deprecated: grafana.index/apikey.ApiKey has been deprecated in favor of grafana.oss/apikey.ApiKey""") - opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) - if not isinstance(opts, pulumi.ResourceOptions): - raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.id is None: - if __props__ is not None: - raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') - __props__ = ApiKeyArgs.__new__(ApiKeyArgs) - - __props__.__dict__["name"] = name - __props__.__dict__["org_id"] = org_id - if role is None and not opts.urn: - raise TypeError("Missing required property 'role'") - __props__.__dict__["role"] = role - __props__.__dict__["seconds_to_live"] = seconds_to_live - __props__.__dict__["expiration"] = None - __props__.__dict__["key"] = None - alias_opts = pulumi.ResourceOptions(aliases=[pulumi.Alias(type_="grafana:index/apiKey:ApiKey")]) - opts = pulumi.ResourceOptions.merge(opts, alias_opts) - secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["key"]) - opts = pulumi.ResourceOptions.merge(opts, secret_opts) - super(ApiKey, __self__).__init__( - 'grafana:index/apiKey:ApiKey', - resource_name, - __props__, - opts) - - @staticmethod - def get(resource_name: str, - id: pulumi.Input[str], - opts: Optional[pulumi.ResourceOptions] = None, - expiration: Optional[pulumi.Input[str]] = None, - key: Optional[pulumi.Input[str]] = None, - name: Optional[pulumi.Input[str]] = None, - org_id: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None) -> 'ApiKey': - """ - Get an existing ApiKey resource's state with the given name, id, and optional extra - properties used to qualify the lookup. - - :param str resource_name: The unique name of the resulting resource. - :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. - :param pulumi.ResourceOptions opts: Options for the resource. - :param pulumi.Input[str] org_id: The Organization ID. If not set, the Org ID defined in the provider block will be used. - """ - opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) - - __props__ = _ApiKeyState.__new__(_ApiKeyState) - - __props__.__dict__["expiration"] = expiration - __props__.__dict__["key"] = key - __props__.__dict__["name"] = name - __props__.__dict__["org_id"] = org_id - __props__.__dict__["role"] = role - __props__.__dict__["seconds_to_live"] = seconds_to_live - return ApiKey(resource_name, opts=opts, __props__=__props__) - - @property - @pulumi.getter - def expiration(self) -> pulumi.Output[str]: - return pulumi.get(self, "expiration") - - @property - @pulumi.getter - def key(self) -> pulumi.Output[str]: - return pulumi.get(self, "key") - - @property - @pulumi.getter - def name(self) -> pulumi.Output[str]: - return pulumi.get(self, "name") - - @property - @pulumi.getter(name="orgId") - def org_id(self) -> pulumi.Output[Optional[str]]: - """ - The Organization ID. If not set, the Org ID defined in the provider block will be used. - """ - return pulumi.get(self, "org_id") - - @property - @pulumi.getter - def role(self) -> pulumi.Output[str]: - return pulumi.get(self, "role") - - @property - @pulumi.getter(name="secondsToLive") - def seconds_to_live(self) -> pulumi.Output[Optional[int]]: - return pulumi.get(self, "seconds_to_live") - diff --git a/sdk/python/pulumiverse_grafana/cloud/api_key.py b/sdk/python/pulumiverse_grafana/cloud/api_key.py deleted file mode 100644 index 91b9232a..00000000 --- a/sdk/python/pulumiverse_grafana/cloud/api_key.py +++ /dev/null @@ -1,325 +0,0 @@ -# coding=utf-8 -# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** -# *** Do not edit by hand unless you're certain you know what you are doing! *** - -import copy -import warnings -import pulumi -import pulumi.runtime -from typing import Any, Mapping, Optional, Sequence, Union, overload -from .. import _utilities - -__all__ = ['ApiKeyArgs', 'ApiKey'] - -@pulumi.input_type -class ApiKeyArgs: - def __init__(__self__, *, - cloud_org_slug: pulumi.Input[str], - role: pulumi.Input[str], - name: Optional[pulumi.Input[str]] = None): - """ - The set of arguments for constructing a ApiKey resource. - :param pulumi.Input[str] cloud_org_slug: The slug of the organization to create the API key in. This is the same slug as the organization name in the URL. - :param pulumi.Input[str] role: Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See https://grafana.com/docs/grafana-cloud/api/#create-api-key for details. - :param pulumi.Input[str] name: Name of the API key. - """ - pulumi.set(__self__, "cloud_org_slug", cloud_org_slug) - pulumi.set(__self__, "role", role) - if name is not None: - pulumi.set(__self__, "name", name) - - @property - @pulumi.getter(name="cloudOrgSlug") - def cloud_org_slug(self) -> pulumi.Input[str]: - """ - The slug of the organization to create the API key in. This is the same slug as the organization name in the URL. - """ - return pulumi.get(self, "cloud_org_slug") - - @cloud_org_slug.setter - def cloud_org_slug(self, value: pulumi.Input[str]): - pulumi.set(self, "cloud_org_slug", value) - - @property - @pulumi.getter - def role(self) -> pulumi.Input[str]: - """ - Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See https://grafana.com/docs/grafana-cloud/api/#create-api-key for details. - """ - return pulumi.get(self, "role") - - @role.setter - def role(self, value: pulumi.Input[str]): - pulumi.set(self, "role", value) - - @property - @pulumi.getter - def name(self) -> Optional[pulumi.Input[str]]: - """ - Name of the API key. - """ - return pulumi.get(self, "name") - - @name.setter - def name(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "name", value) - - -@pulumi.input_type -class _ApiKeyState: - def __init__(__self__, *, - cloud_org_slug: Optional[pulumi.Input[str]] = None, - key: Optional[pulumi.Input[str]] = None, - name: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None): - """ - Input properties used for looking up and filtering ApiKey resources. - :param pulumi.Input[str] cloud_org_slug: The slug of the organization to create the API key in. This is the same slug as the organization name in the URL. - :param pulumi.Input[str] key: The generated API key. - :param pulumi.Input[str] name: Name of the API key. - :param pulumi.Input[str] role: Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See https://grafana.com/docs/grafana-cloud/api/#create-api-key for details. - """ - if cloud_org_slug is not None: - pulumi.set(__self__, "cloud_org_slug", cloud_org_slug) - if key is not None: - pulumi.set(__self__, "key", key) - if name is not None: - pulumi.set(__self__, "name", name) - if role is not None: - pulumi.set(__self__, "role", role) - - @property - @pulumi.getter(name="cloudOrgSlug") - def cloud_org_slug(self) -> Optional[pulumi.Input[str]]: - """ - The slug of the organization to create the API key in. This is the same slug as the organization name in the URL. - """ - return pulumi.get(self, "cloud_org_slug") - - @cloud_org_slug.setter - def cloud_org_slug(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "cloud_org_slug", value) - - @property - @pulumi.getter - def key(self) -> Optional[pulumi.Input[str]]: - """ - The generated API key. - """ - return pulumi.get(self, "key") - - @key.setter - def key(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "key", value) - - @property - @pulumi.getter - def name(self) -> Optional[pulumi.Input[str]]: - """ - Name of the API key. - """ - return pulumi.get(self, "name") - - @name.setter - def name(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "name", value) - - @property - @pulumi.getter - def role(self) -> Optional[pulumi.Input[str]]: - """ - Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See https://grafana.com/docs/grafana-cloud/api/#create-api-key for details. - """ - return pulumi.get(self, "role") - - @role.setter - def role(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "role", value) - - -class ApiKey(pulumi.CustomResource): - @overload - def __init__(__self__, - resource_name: str, - opts: Optional[pulumi.ResourceOptions] = None, - cloud_org_slug: Optional[pulumi.Input[str]] = None, - name: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - __props__=None): - """ - This resource is deprecated and will be removed in a future release. Please use cloud.AccessPolicy instead. - - Manages a single API key on the Grafana Cloud portal (on the organization level) - * [API documentation](https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#api-keys) - - Required access policy scopes: - - * api-keys:read - * api-keys:write - * api-keys:delete - - ## Example Usage - - ```python - import pulumi - import pulumiverse_grafana as grafana - - test = grafana.cloud.ApiKey("test", - cloud_org_slug="myorg", - role="Admin") - ``` - - ## Import - - ```sh - $ pulumi import grafana:cloud/apiKey:ApiKey name "{{ orgSlug }}:{{ apiKeyName }}" - ``` - - :param str resource_name: The name of the resource. - :param pulumi.ResourceOptions opts: Options for the resource. - :param pulumi.Input[str] cloud_org_slug: The slug of the organization to create the API key in. This is the same slug as the organization name in the URL. - :param pulumi.Input[str] name: Name of the API key. - :param pulumi.Input[str] role: Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See https://grafana.com/docs/grafana-cloud/api/#create-api-key for details. - """ - ... - @overload - def __init__(__self__, - resource_name: str, - args: ApiKeyArgs, - opts: Optional[pulumi.ResourceOptions] = None): - """ - This resource is deprecated and will be removed in a future release. Please use cloud.AccessPolicy instead. - - Manages a single API key on the Grafana Cloud portal (on the organization level) - * [API documentation](https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#api-keys) - - Required access policy scopes: - - * api-keys:read - * api-keys:write - * api-keys:delete - - ## Example Usage - - ```python - import pulumi - import pulumiverse_grafana as grafana - - test = grafana.cloud.ApiKey("test", - cloud_org_slug="myorg", - role="Admin") - ``` - - ## Import - - ```sh - $ pulumi import grafana:cloud/apiKey:ApiKey name "{{ orgSlug }}:{{ apiKeyName }}" - ``` - - :param str resource_name: The name of the resource. - :param ApiKeyArgs args: The arguments to use to populate this resource's properties. - :param pulumi.ResourceOptions opts: Options for the resource. - """ - ... - def __init__(__self__, resource_name: str, *args, **kwargs): - resource_args, opts = _utilities.get_resource_args_opts(ApiKeyArgs, pulumi.ResourceOptions, *args, **kwargs) - if resource_args is not None: - __self__._internal_init(resource_name, opts, **resource_args.__dict__) - else: - __self__._internal_init(resource_name, *args, **kwargs) - - def _internal_init(__self__, - resource_name: str, - opts: Optional[pulumi.ResourceOptions] = None, - cloud_org_slug: Optional[pulumi.Input[str]] = None, - name: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - __props__=None): - opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) - if not isinstance(opts, pulumi.ResourceOptions): - raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.id is None: - if __props__ is not None: - raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') - __props__ = ApiKeyArgs.__new__(ApiKeyArgs) - - if cloud_org_slug is None and not opts.urn: - raise TypeError("Missing required property 'cloud_org_slug'") - __props__.__dict__["cloud_org_slug"] = cloud_org_slug - __props__.__dict__["name"] = name - if role is None and not opts.urn: - raise TypeError("Missing required property 'role'") - __props__.__dict__["role"] = role - __props__.__dict__["key"] = None - alias_opts = pulumi.ResourceOptions(aliases=[pulumi.Alias(type_="grafana:index/cloudApiKey:CloudApiKey")]) - opts = pulumi.ResourceOptions.merge(opts, alias_opts) - secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["key"]) - opts = pulumi.ResourceOptions.merge(opts, secret_opts) - super(ApiKey, __self__).__init__( - 'grafana:cloud/apiKey:ApiKey', - resource_name, - __props__, - opts) - - @staticmethod - def get(resource_name: str, - id: pulumi.Input[str], - opts: Optional[pulumi.ResourceOptions] = None, - cloud_org_slug: Optional[pulumi.Input[str]] = None, - key: Optional[pulumi.Input[str]] = None, - name: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None) -> 'ApiKey': - """ - Get an existing ApiKey resource's state with the given name, id, and optional extra - properties used to qualify the lookup. - - :param str resource_name: The unique name of the resulting resource. - :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. - :param pulumi.ResourceOptions opts: Options for the resource. - :param pulumi.Input[str] cloud_org_slug: The slug of the organization to create the API key in. This is the same slug as the organization name in the URL. - :param pulumi.Input[str] key: The generated API key. - :param pulumi.Input[str] name: Name of the API key. - :param pulumi.Input[str] role: Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See https://grafana.com/docs/grafana-cloud/api/#create-api-key for details. - """ - opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) - - __props__ = _ApiKeyState.__new__(_ApiKeyState) - - __props__.__dict__["cloud_org_slug"] = cloud_org_slug - __props__.__dict__["key"] = key - __props__.__dict__["name"] = name - __props__.__dict__["role"] = role - return ApiKey(resource_name, opts=opts, __props__=__props__) - - @property - @pulumi.getter(name="cloudOrgSlug") - def cloud_org_slug(self) -> pulumi.Output[str]: - """ - The slug of the organization to create the API key in. This is the same slug as the organization name in the URL. - """ - return pulumi.get(self, "cloud_org_slug") - - @property - @pulumi.getter - def key(self) -> pulumi.Output[str]: - """ - The generated API key. - """ - return pulumi.get(self, "key") - - @property - @pulumi.getter - def name(self) -> pulumi.Output[str]: - """ - Name of the API key. - """ - return pulumi.get(self, "name") - - @property - @pulumi.getter - def role(self) -> pulumi.Output[str]: - """ - Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See https://grafana.com/docs/grafana-cloud/api/#create-api-key for details. - """ - return pulumi.get(self, "role") - diff --git a/sdk/python/pulumiverse_grafana/cloud/stack_api_key.py b/sdk/python/pulumiverse_grafana/cloud/stack_api_key.py deleted file mode 100644 index f46386df..00000000 --- a/sdk/python/pulumiverse_grafana/cloud/stack_api_key.py +++ /dev/null @@ -1,278 +0,0 @@ -# coding=utf-8 -# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** -# *** Do not edit by hand unless you're certain you know what you are doing! *** - -import copy -import warnings -import pulumi -import pulumi.runtime -from typing import Any, Mapping, Optional, Sequence, Union, overload -from .. import _utilities - -__all__ = ['StackApiKeyArgs', 'StackApiKey'] - -@pulumi.input_type -class StackApiKeyArgs: - def __init__(__self__, *, - role: pulumi.Input[str], - stack_slug: pulumi.Input[str], - name: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None): - """ - The set of arguments for constructing a StackApiKey resource. - """ - pulumi.set(__self__, "role", role) - pulumi.set(__self__, "stack_slug", stack_slug) - if name is not None: - pulumi.set(__self__, "name", name) - if seconds_to_live is not None: - pulumi.set(__self__, "seconds_to_live", seconds_to_live) - - @property - @pulumi.getter - def role(self) -> pulumi.Input[str]: - return pulumi.get(self, "role") - - @role.setter - def role(self, value: pulumi.Input[str]): - pulumi.set(self, "role", value) - - @property - @pulumi.getter(name="stackSlug") - def stack_slug(self) -> pulumi.Input[str]: - return pulumi.get(self, "stack_slug") - - @stack_slug.setter - def stack_slug(self, value: pulumi.Input[str]): - pulumi.set(self, "stack_slug", value) - - @property - @pulumi.getter - def name(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "name") - - @name.setter - def name(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "name", value) - - @property - @pulumi.getter(name="secondsToLive") - def seconds_to_live(self) -> Optional[pulumi.Input[int]]: - return pulumi.get(self, "seconds_to_live") - - @seconds_to_live.setter - def seconds_to_live(self, value: Optional[pulumi.Input[int]]): - pulumi.set(self, "seconds_to_live", value) - - -@pulumi.input_type -class _StackApiKeyState: - def __init__(__self__, *, - expiration: Optional[pulumi.Input[str]] = None, - key: Optional[pulumi.Input[str]] = None, - name: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None, - stack_slug: Optional[pulumi.Input[str]] = None): - """ - Input properties used for looking up and filtering StackApiKey resources. - """ - if expiration is not None: - pulumi.set(__self__, "expiration", expiration) - if key is not None: - pulumi.set(__self__, "key", key) - if name is not None: - pulumi.set(__self__, "name", name) - if role is not None: - pulumi.set(__self__, "role", role) - if seconds_to_live is not None: - pulumi.set(__self__, "seconds_to_live", seconds_to_live) - if stack_slug is not None: - pulumi.set(__self__, "stack_slug", stack_slug) - - @property - @pulumi.getter - def expiration(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "expiration") - - @expiration.setter - def expiration(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "expiration", value) - - @property - @pulumi.getter - def key(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "key") - - @key.setter - def key(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "key", value) - - @property - @pulumi.getter - def name(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "name") - - @name.setter - def name(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "name", value) - - @property - @pulumi.getter - def role(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "role") - - @role.setter - def role(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "role", value) - - @property - @pulumi.getter(name="secondsToLive") - def seconds_to_live(self) -> Optional[pulumi.Input[int]]: - return pulumi.get(self, "seconds_to_live") - - @seconds_to_live.setter - def seconds_to_live(self, value: Optional[pulumi.Input[int]]): - pulumi.set(self, "seconds_to_live", value) - - @property - @pulumi.getter(name="stackSlug") - def stack_slug(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "stack_slug") - - @stack_slug.setter - def stack_slug(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "stack_slug", value) - - -class StackApiKey(pulumi.CustomResource): - @overload - def __init__(__self__, - resource_name: str, - opts: Optional[pulumi.ResourceOptions] = None, - name: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None, - stack_slug: Optional[pulumi.Input[str]] = None, - __props__=None): - """ - Create a StackApiKey resource with the given unique name, props, and options. - :param str resource_name: The name of the resource. - :param pulumi.ResourceOptions opts: Options for the resource. - """ - ... - @overload - def __init__(__self__, - resource_name: str, - args: StackApiKeyArgs, - opts: Optional[pulumi.ResourceOptions] = None): - """ - Create a StackApiKey resource with the given unique name, props, and options. - :param str resource_name: The name of the resource. - :param StackApiKeyArgs args: The arguments to use to populate this resource's properties. - :param pulumi.ResourceOptions opts: Options for the resource. - """ - ... - def __init__(__self__, resource_name: str, *args, **kwargs): - resource_args, opts = _utilities.get_resource_args_opts(StackApiKeyArgs, pulumi.ResourceOptions, *args, **kwargs) - if resource_args is not None: - __self__._internal_init(resource_name, opts, **resource_args.__dict__) - else: - __self__._internal_init(resource_name, *args, **kwargs) - - def _internal_init(__self__, - resource_name: str, - opts: Optional[pulumi.ResourceOptions] = None, - name: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None, - stack_slug: Optional[pulumi.Input[str]] = None, - __props__=None): - opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) - if not isinstance(opts, pulumi.ResourceOptions): - raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.id is None: - if __props__ is not None: - raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') - __props__ = StackApiKeyArgs.__new__(StackApiKeyArgs) - - __props__.__dict__["name"] = name - if role is None and not opts.urn: - raise TypeError("Missing required property 'role'") - __props__.__dict__["role"] = role - __props__.__dict__["seconds_to_live"] = seconds_to_live - if stack_slug is None and not opts.urn: - raise TypeError("Missing required property 'stack_slug'") - __props__.__dict__["stack_slug"] = stack_slug - __props__.__dict__["expiration"] = None - __props__.__dict__["key"] = None - alias_opts = pulumi.ResourceOptions(aliases=[pulumi.Alias(type_="grafana:index/cloudStackApiKey:CloudStackApiKey")]) - opts = pulumi.ResourceOptions.merge(opts, alias_opts) - secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["key"]) - opts = pulumi.ResourceOptions.merge(opts, secret_opts) - super(StackApiKey, __self__).__init__( - 'grafana:cloud/stackApiKey:StackApiKey', - resource_name, - __props__, - opts) - - @staticmethod - def get(resource_name: str, - id: pulumi.Input[str], - opts: Optional[pulumi.ResourceOptions] = None, - expiration: Optional[pulumi.Input[str]] = None, - key: Optional[pulumi.Input[str]] = None, - name: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None, - stack_slug: Optional[pulumi.Input[str]] = None) -> 'StackApiKey': - """ - Get an existing StackApiKey resource's state with the given name, id, and optional extra - properties used to qualify the lookup. - - :param str resource_name: The unique name of the resulting resource. - :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. - :param pulumi.ResourceOptions opts: Options for the resource. - """ - opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) - - __props__ = _StackApiKeyState.__new__(_StackApiKeyState) - - __props__.__dict__["expiration"] = expiration - __props__.__dict__["key"] = key - __props__.__dict__["name"] = name - __props__.__dict__["role"] = role - __props__.__dict__["seconds_to_live"] = seconds_to_live - __props__.__dict__["stack_slug"] = stack_slug - return StackApiKey(resource_name, opts=opts, __props__=__props__) - - @property - @pulumi.getter - def expiration(self) -> pulumi.Output[str]: - return pulumi.get(self, "expiration") - - @property - @pulumi.getter - def key(self) -> pulumi.Output[str]: - return pulumi.get(self, "key") - - @property - @pulumi.getter - def name(self) -> pulumi.Output[str]: - return pulumi.get(self, "name") - - @property - @pulumi.getter - def role(self) -> pulumi.Output[str]: - return pulumi.get(self, "role") - - @property - @pulumi.getter(name="secondsToLive") - def seconds_to_live(self) -> pulumi.Output[Optional[int]]: - return pulumi.get(self, "seconds_to_live") - - @property - @pulumi.getter(name="stackSlug") - def stack_slug(self) -> pulumi.Output[str]: - return pulumi.get(self, "stack_slug") - diff --git a/sdk/python/pulumiverse_grafana/cloud_api_key.py b/sdk/python/pulumiverse_grafana/cloud_api_key.py deleted file mode 100644 index cc0aa4fb..00000000 --- a/sdk/python/pulumiverse_grafana/cloud_api_key.py +++ /dev/null @@ -1,284 +0,0 @@ -# coding=utf-8 -# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** -# *** Do not edit by hand unless you're certain you know what you are doing! *** - -import copy -import warnings -import pulumi -import pulumi.runtime -from typing import Any, Mapping, Optional, Sequence, Union, overload -from . import _utilities - -__all__ = ['CloudApiKeyArgs', 'CloudApiKey'] - -@pulumi.input_type -class CloudApiKeyArgs: - def __init__(__self__, *, - cloud_org_slug: pulumi.Input[str], - role: pulumi.Input[str], - name: Optional[pulumi.Input[str]] = None): - """ - The set of arguments for constructing a CloudApiKey resource. - :param pulumi.Input[str] cloud_org_slug: The slug of the organization to create the API key in. This is the same slug as the organization name in the URL. - :param pulumi.Input[str] role: Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See - https://grafana.com/docs/grafana-cloud/api/#create-api-key for details. - :param pulumi.Input[str] name: Name of the API key. - """ - pulumi.set(__self__, "cloud_org_slug", cloud_org_slug) - pulumi.set(__self__, "role", role) - if name is not None: - pulumi.set(__self__, "name", name) - - @property - @pulumi.getter(name="cloudOrgSlug") - def cloud_org_slug(self) -> pulumi.Input[str]: - """ - The slug of the organization to create the API key in. This is the same slug as the organization name in the URL. - """ - return pulumi.get(self, "cloud_org_slug") - - @cloud_org_slug.setter - def cloud_org_slug(self, value: pulumi.Input[str]): - pulumi.set(self, "cloud_org_slug", value) - - @property - @pulumi.getter - def role(self) -> pulumi.Input[str]: - """ - Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See - https://grafana.com/docs/grafana-cloud/api/#create-api-key for details. - """ - return pulumi.get(self, "role") - - @role.setter - def role(self, value: pulumi.Input[str]): - pulumi.set(self, "role", value) - - @property - @pulumi.getter - def name(self) -> Optional[pulumi.Input[str]]: - """ - Name of the API key. - """ - return pulumi.get(self, "name") - - @name.setter - def name(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "name", value) - - -@pulumi.input_type -class _CloudApiKeyState: - def __init__(__self__, *, - cloud_org_slug: Optional[pulumi.Input[str]] = None, - key: Optional[pulumi.Input[str]] = None, - name: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None): - """ - Input properties used for looking up and filtering CloudApiKey resources. - :param pulumi.Input[str] cloud_org_slug: The slug of the organization to create the API key in. This is the same slug as the organization name in the URL. - :param pulumi.Input[str] key: The generated API key. - :param pulumi.Input[str] name: Name of the API key. - :param pulumi.Input[str] role: Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See - https://grafana.com/docs/grafana-cloud/api/#create-api-key for details. - """ - if cloud_org_slug is not None: - pulumi.set(__self__, "cloud_org_slug", cloud_org_slug) - if key is not None: - pulumi.set(__self__, "key", key) - if name is not None: - pulumi.set(__self__, "name", name) - if role is not None: - pulumi.set(__self__, "role", role) - - @property - @pulumi.getter(name="cloudOrgSlug") - def cloud_org_slug(self) -> Optional[pulumi.Input[str]]: - """ - The slug of the organization to create the API key in. This is the same slug as the organization name in the URL. - """ - return pulumi.get(self, "cloud_org_slug") - - @cloud_org_slug.setter - def cloud_org_slug(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "cloud_org_slug", value) - - @property - @pulumi.getter - def key(self) -> Optional[pulumi.Input[str]]: - """ - The generated API key. - """ - return pulumi.get(self, "key") - - @key.setter - def key(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "key", value) - - @property - @pulumi.getter - def name(self) -> Optional[pulumi.Input[str]]: - """ - Name of the API key. - """ - return pulumi.get(self, "name") - - @name.setter - def name(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "name", value) - - @property - @pulumi.getter - def role(self) -> Optional[pulumi.Input[str]]: - """ - Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See - https://grafana.com/docs/grafana-cloud/api/#create-api-key for details. - """ - return pulumi.get(self, "role") - - @role.setter - def role(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "role", value) - - -warnings.warn("""grafana.index/cloudapikey.CloudApiKey has been deprecated in favor of grafana.cloud/apikey.ApiKey""", DeprecationWarning) - - -class CloudApiKey(pulumi.CustomResource): - warnings.warn("""grafana.index/cloudapikey.CloudApiKey has been deprecated in favor of grafana.cloud/apikey.ApiKey""", DeprecationWarning) - - @overload - def __init__(__self__, - resource_name: str, - opts: Optional[pulumi.ResourceOptions] = None, - cloud_org_slug: Optional[pulumi.Input[str]] = None, - name: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - __props__=None): - """ - Create a CloudApiKey resource with the given unique name, props, and options. - :param str resource_name: The name of the resource. - :param pulumi.ResourceOptions opts: Options for the resource. - :param pulumi.Input[str] cloud_org_slug: The slug of the organization to create the API key in. This is the same slug as the organization name in the URL. - :param pulumi.Input[str] name: Name of the API key. - :param pulumi.Input[str] role: Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See - https://grafana.com/docs/grafana-cloud/api/#create-api-key for details. - """ - ... - @overload - def __init__(__self__, - resource_name: str, - args: CloudApiKeyArgs, - opts: Optional[pulumi.ResourceOptions] = None): - """ - Create a CloudApiKey resource with the given unique name, props, and options. - :param str resource_name: The name of the resource. - :param CloudApiKeyArgs args: The arguments to use to populate this resource's properties. - :param pulumi.ResourceOptions opts: Options for the resource. - """ - ... - def __init__(__self__, resource_name: str, *args, **kwargs): - resource_args, opts = _utilities.get_resource_args_opts(CloudApiKeyArgs, pulumi.ResourceOptions, *args, **kwargs) - if resource_args is not None: - __self__._internal_init(resource_name, opts, **resource_args.__dict__) - else: - __self__._internal_init(resource_name, *args, **kwargs) - - def _internal_init(__self__, - resource_name: str, - opts: Optional[pulumi.ResourceOptions] = None, - cloud_org_slug: Optional[pulumi.Input[str]] = None, - name: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - __props__=None): - pulumi.log.warn("""CloudApiKey is deprecated: grafana.index/cloudapikey.CloudApiKey has been deprecated in favor of grafana.cloud/apikey.ApiKey""") - opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) - if not isinstance(opts, pulumi.ResourceOptions): - raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.id is None: - if __props__ is not None: - raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') - __props__ = CloudApiKeyArgs.__new__(CloudApiKeyArgs) - - if cloud_org_slug is None and not opts.urn: - raise TypeError("Missing required property 'cloud_org_slug'") - __props__.__dict__["cloud_org_slug"] = cloud_org_slug - __props__.__dict__["name"] = name - if role is None and not opts.urn: - raise TypeError("Missing required property 'role'") - __props__.__dict__["role"] = role - __props__.__dict__["key"] = None - alias_opts = pulumi.ResourceOptions(aliases=[pulumi.Alias(type_="grafana:index/cloudApiKey:CloudApiKey")]) - opts = pulumi.ResourceOptions.merge(opts, alias_opts) - secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["key"]) - opts = pulumi.ResourceOptions.merge(opts, secret_opts) - super(CloudApiKey, __self__).__init__( - 'grafana:index/cloudApiKey:CloudApiKey', - resource_name, - __props__, - opts) - - @staticmethod - def get(resource_name: str, - id: pulumi.Input[str], - opts: Optional[pulumi.ResourceOptions] = None, - cloud_org_slug: Optional[pulumi.Input[str]] = None, - key: Optional[pulumi.Input[str]] = None, - name: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None) -> 'CloudApiKey': - """ - Get an existing CloudApiKey resource's state with the given name, id, and optional extra - properties used to qualify the lookup. - - :param str resource_name: The unique name of the resulting resource. - :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. - :param pulumi.ResourceOptions opts: Options for the resource. - :param pulumi.Input[str] cloud_org_slug: The slug of the organization to create the API key in. This is the same slug as the organization name in the URL. - :param pulumi.Input[str] key: The generated API key. - :param pulumi.Input[str] name: Name of the API key. - :param pulumi.Input[str] role: Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See - https://grafana.com/docs/grafana-cloud/api/#create-api-key for details. - """ - opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) - - __props__ = _CloudApiKeyState.__new__(_CloudApiKeyState) - - __props__.__dict__["cloud_org_slug"] = cloud_org_slug - __props__.__dict__["key"] = key - __props__.__dict__["name"] = name - __props__.__dict__["role"] = role - return CloudApiKey(resource_name, opts=opts, __props__=__props__) - - @property - @pulumi.getter(name="cloudOrgSlug") - def cloud_org_slug(self) -> pulumi.Output[str]: - """ - The slug of the organization to create the API key in. This is the same slug as the organization name in the URL. - """ - return pulumi.get(self, "cloud_org_slug") - - @property - @pulumi.getter - def key(self) -> pulumi.Output[str]: - """ - The generated API key. - """ - return pulumi.get(self, "key") - - @property - @pulumi.getter - def name(self) -> pulumi.Output[str]: - """ - Name of the API key. - """ - return pulumi.get(self, "name") - - @property - @pulumi.getter - def role(self) -> pulumi.Output[str]: - """ - Role of the API key. Should be one of [Viewer Editor Admin MetricsPublisher PluginPublisher]. See - https://grafana.com/docs/grafana-cloud/api/#create-api-key for details. - """ - return pulumi.get(self, "role") - diff --git a/sdk/python/pulumiverse_grafana/cloud_stack_api_key.py b/sdk/python/pulumiverse_grafana/cloud_stack_api_key.py deleted file mode 100644 index 549a9b3c..00000000 --- a/sdk/python/pulumiverse_grafana/cloud_stack_api_key.py +++ /dev/null @@ -1,284 +0,0 @@ -# coding=utf-8 -# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** -# *** Do not edit by hand unless you're certain you know what you are doing! *** - -import copy -import warnings -import pulumi -import pulumi.runtime -from typing import Any, Mapping, Optional, Sequence, Union, overload -from . import _utilities - -__all__ = ['CloudStackApiKeyArgs', 'CloudStackApiKey'] - -@pulumi.input_type -class CloudStackApiKeyArgs: - def __init__(__self__, *, - role: pulumi.Input[str], - stack_slug: pulumi.Input[str], - name: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None): - """ - The set of arguments for constructing a CloudStackApiKey resource. - """ - pulumi.set(__self__, "role", role) - pulumi.set(__self__, "stack_slug", stack_slug) - if name is not None: - pulumi.set(__self__, "name", name) - if seconds_to_live is not None: - pulumi.set(__self__, "seconds_to_live", seconds_to_live) - - @property - @pulumi.getter - def role(self) -> pulumi.Input[str]: - return pulumi.get(self, "role") - - @role.setter - def role(self, value: pulumi.Input[str]): - pulumi.set(self, "role", value) - - @property - @pulumi.getter(name="stackSlug") - def stack_slug(self) -> pulumi.Input[str]: - return pulumi.get(self, "stack_slug") - - @stack_slug.setter - def stack_slug(self, value: pulumi.Input[str]): - pulumi.set(self, "stack_slug", value) - - @property - @pulumi.getter - def name(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "name") - - @name.setter - def name(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "name", value) - - @property - @pulumi.getter(name="secondsToLive") - def seconds_to_live(self) -> Optional[pulumi.Input[int]]: - return pulumi.get(self, "seconds_to_live") - - @seconds_to_live.setter - def seconds_to_live(self, value: Optional[pulumi.Input[int]]): - pulumi.set(self, "seconds_to_live", value) - - -@pulumi.input_type -class _CloudStackApiKeyState: - def __init__(__self__, *, - expiration: Optional[pulumi.Input[str]] = None, - key: Optional[pulumi.Input[str]] = None, - name: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None, - stack_slug: Optional[pulumi.Input[str]] = None): - """ - Input properties used for looking up and filtering CloudStackApiKey resources. - """ - if expiration is not None: - pulumi.set(__self__, "expiration", expiration) - if key is not None: - pulumi.set(__self__, "key", key) - if name is not None: - pulumi.set(__self__, "name", name) - if role is not None: - pulumi.set(__self__, "role", role) - if seconds_to_live is not None: - pulumi.set(__self__, "seconds_to_live", seconds_to_live) - if stack_slug is not None: - pulumi.set(__self__, "stack_slug", stack_slug) - - @property - @pulumi.getter - def expiration(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "expiration") - - @expiration.setter - def expiration(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "expiration", value) - - @property - @pulumi.getter - def key(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "key") - - @key.setter - def key(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "key", value) - - @property - @pulumi.getter - def name(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "name") - - @name.setter - def name(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "name", value) - - @property - @pulumi.getter - def role(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "role") - - @role.setter - def role(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "role", value) - - @property - @pulumi.getter(name="secondsToLive") - def seconds_to_live(self) -> Optional[pulumi.Input[int]]: - return pulumi.get(self, "seconds_to_live") - - @seconds_to_live.setter - def seconds_to_live(self, value: Optional[pulumi.Input[int]]): - pulumi.set(self, "seconds_to_live", value) - - @property - @pulumi.getter(name="stackSlug") - def stack_slug(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "stack_slug") - - @stack_slug.setter - def stack_slug(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "stack_slug", value) - - -warnings.warn("""grafana.index/cloudstackapikey.CloudStackApiKey has been deprecated in favor of grafana.cloud/stackapikey.StackApiKey""", DeprecationWarning) - - -class CloudStackApiKey(pulumi.CustomResource): - warnings.warn("""grafana.index/cloudstackapikey.CloudStackApiKey has been deprecated in favor of grafana.cloud/stackapikey.StackApiKey""", DeprecationWarning) - - @overload - def __init__(__self__, - resource_name: str, - opts: Optional[pulumi.ResourceOptions] = None, - name: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None, - stack_slug: Optional[pulumi.Input[str]] = None, - __props__=None): - """ - Create a CloudStackApiKey resource with the given unique name, props, and options. - :param str resource_name: The name of the resource. - :param pulumi.ResourceOptions opts: Options for the resource. - """ - ... - @overload - def __init__(__self__, - resource_name: str, - args: CloudStackApiKeyArgs, - opts: Optional[pulumi.ResourceOptions] = None): - """ - Create a CloudStackApiKey resource with the given unique name, props, and options. - :param str resource_name: The name of the resource. - :param CloudStackApiKeyArgs args: The arguments to use to populate this resource's properties. - :param pulumi.ResourceOptions opts: Options for the resource. - """ - ... - def __init__(__self__, resource_name: str, *args, **kwargs): - resource_args, opts = _utilities.get_resource_args_opts(CloudStackApiKeyArgs, pulumi.ResourceOptions, *args, **kwargs) - if resource_args is not None: - __self__._internal_init(resource_name, opts, **resource_args.__dict__) - else: - __self__._internal_init(resource_name, *args, **kwargs) - - def _internal_init(__self__, - resource_name: str, - opts: Optional[pulumi.ResourceOptions] = None, - name: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None, - stack_slug: Optional[pulumi.Input[str]] = None, - __props__=None): - pulumi.log.warn("""CloudStackApiKey is deprecated: grafana.index/cloudstackapikey.CloudStackApiKey has been deprecated in favor of grafana.cloud/stackapikey.StackApiKey""") - opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) - if not isinstance(opts, pulumi.ResourceOptions): - raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.id is None: - if __props__ is not None: - raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') - __props__ = CloudStackApiKeyArgs.__new__(CloudStackApiKeyArgs) - - __props__.__dict__["name"] = name - if role is None and not opts.urn: - raise TypeError("Missing required property 'role'") - __props__.__dict__["role"] = role - __props__.__dict__["seconds_to_live"] = seconds_to_live - if stack_slug is None and not opts.urn: - raise TypeError("Missing required property 'stack_slug'") - __props__.__dict__["stack_slug"] = stack_slug - __props__.__dict__["expiration"] = None - __props__.__dict__["key"] = None - alias_opts = pulumi.ResourceOptions(aliases=[pulumi.Alias(type_="grafana:index/cloudStackApiKey:CloudStackApiKey")]) - opts = pulumi.ResourceOptions.merge(opts, alias_opts) - secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["key"]) - opts = pulumi.ResourceOptions.merge(opts, secret_opts) - super(CloudStackApiKey, __self__).__init__( - 'grafana:index/cloudStackApiKey:CloudStackApiKey', - resource_name, - __props__, - opts) - - @staticmethod - def get(resource_name: str, - id: pulumi.Input[str], - opts: Optional[pulumi.ResourceOptions] = None, - expiration: Optional[pulumi.Input[str]] = None, - key: Optional[pulumi.Input[str]] = None, - name: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None, - stack_slug: Optional[pulumi.Input[str]] = None) -> 'CloudStackApiKey': - """ - Get an existing CloudStackApiKey resource's state with the given name, id, and optional extra - properties used to qualify the lookup. - - :param str resource_name: The unique name of the resulting resource. - :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. - :param pulumi.ResourceOptions opts: Options for the resource. - """ - opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) - - __props__ = _CloudStackApiKeyState.__new__(_CloudStackApiKeyState) - - __props__.__dict__["expiration"] = expiration - __props__.__dict__["key"] = key - __props__.__dict__["name"] = name - __props__.__dict__["role"] = role - __props__.__dict__["seconds_to_live"] = seconds_to_live - __props__.__dict__["stack_slug"] = stack_slug - return CloudStackApiKey(resource_name, opts=opts, __props__=__props__) - - @property - @pulumi.getter - def expiration(self) -> pulumi.Output[str]: - return pulumi.get(self, "expiration") - - @property - @pulumi.getter - def key(self) -> pulumi.Output[str]: - return pulumi.get(self, "key") - - @property - @pulumi.getter - def name(self) -> pulumi.Output[str]: - return pulumi.get(self, "name") - - @property - @pulumi.getter - def role(self) -> pulumi.Output[str]: - return pulumi.get(self, "role") - - @property - @pulumi.getter(name="secondsToLive") - def seconds_to_live(self) -> pulumi.Output[Optional[int]]: - return pulumi.get(self, "seconds_to_live") - - @property - @pulumi.getter(name="stackSlug") - def stack_slug(self) -> pulumi.Output[str]: - return pulumi.get(self, "stack_slug") - diff --git a/sdk/python/pulumiverse_grafana/get_oncall_action.py b/sdk/python/pulumiverse_grafana/get_oncall_action.py deleted file mode 100644 index bc270ae2..00000000 --- a/sdk/python/pulumiverse_grafana/get_oncall_action.py +++ /dev/null @@ -1,81 +0,0 @@ -# coding=utf-8 -# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** -# *** Do not edit by hand unless you're certain you know what you are doing! *** - -import copy -import warnings -import pulumi -import pulumi.runtime -from typing import Any, Mapping, Optional, Sequence, Union, overload -from . import _utilities - -__all__ = [ - 'GetOncallActionResult', - 'AwaitableGetOncallActionResult', - 'get_oncall_action', - 'get_oncall_action_output', -] - -warnings.warn("""grafana.index/getoncallaction.getOncallAction has been deprecated in favor of grafana.oncall/getaction.getAction""", DeprecationWarning) - -@pulumi.output_type -class GetOncallActionResult: - """ - A collection of values returned by getOncallAction. - """ - def __init__(__self__, id=None, name=None): - if id and not isinstance(id, str): - raise TypeError("Expected argument 'id' to be a str") - pulumi.set(__self__, "id", id) - if name and not isinstance(name, str): - raise TypeError("Expected argument 'name' to be a str") - pulumi.set(__self__, "name", name) - - @property - @pulumi.getter - def id(self) -> str: - """ - The provider-assigned unique ID for this managed resource. - """ - return pulumi.get(self, "id") - - @property - @pulumi.getter - def name(self) -> str: - return pulumi.get(self, "name") - - -class AwaitableGetOncallActionResult(GetOncallActionResult): - # pylint: disable=using-constant-test - def __await__(self): - if False: - yield self - return GetOncallActionResult( - id=self.id, - name=self.name) - - -def get_oncall_action(name: Optional[str] = None, - opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetOncallActionResult: - """ - Use this data source to access information about an existing resource. - """ - pulumi.log.warn("""get_oncall_action is deprecated: grafana.index/getoncallaction.getOncallAction has been deprecated in favor of grafana.oncall/getaction.getAction""") - __args__ = dict() - __args__['name'] = name - opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) - __ret__ = pulumi.runtime.invoke('grafana:index/getOncallAction:getOncallAction', __args__, opts=opts, typ=GetOncallActionResult).value - - return AwaitableGetOncallActionResult( - id=pulumi.get(__ret__, 'id'), - name=pulumi.get(__ret__, 'name')) - - -@_utilities.lift_output_func(get_oncall_action) -def get_oncall_action_output(name: Optional[pulumi.Input[str]] = None, - opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetOncallActionResult]: - """ - Use this data source to access information about an existing resource. - """ - pulumi.log.warn("""get_oncall_action is deprecated: grafana.index/getoncallaction.getOncallAction has been deprecated in favor of grafana.oncall/getaction.getAction""") - ... diff --git a/sdk/python/pulumiverse_grafana/oncall/get_action.py b/sdk/python/pulumiverse_grafana/oncall/get_action.py deleted file mode 100644 index 1e6d4d74..00000000 --- a/sdk/python/pulumiverse_grafana/oncall/get_action.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding=utf-8 -# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** -# *** Do not edit by hand unless you're certain you know what you are doing! *** - -import copy -import warnings -import pulumi -import pulumi.runtime -from typing import Any, Mapping, Optional, Sequence, Union, overload -from .. import _utilities - -__all__ = [ - 'GetActionResult', - 'AwaitableGetActionResult', - 'get_action', - 'get_action_output', -] - -@pulumi.output_type -class GetActionResult: - """ - A collection of values returned by getAction. - """ - def __init__(__self__, id=None, name=None): - if id and not isinstance(id, str): - raise TypeError("Expected argument 'id' to be a str") - pulumi.set(__self__, "id", id) - if name and not isinstance(name, str): - raise TypeError("Expected argument 'name' to be a str") - pulumi.set(__self__, "name", name) - - @property - @pulumi.getter - def id(self) -> str: - """ - The provider-assigned unique ID for this managed resource. - """ - return pulumi.get(self, "id") - - @property - @pulumi.getter - def name(self) -> str: - """ - The action name. - """ - return pulumi.get(self, "name") - - -class AwaitableGetActionResult(GetActionResult): - # pylint: disable=using-constant-test - def __await__(self): - if False: - yield self - return GetActionResult( - id=self.id, - name=self.name) - - -def get_action(name: Optional[str] = None, - opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetActionResult: - """ - **Note:** This data source is going to be deprecated, please use outgoing webhook data source instead. - * [HTTP API](https://grafana.com/docs/oncall/latest/oncall-api-reference/outgoing_webhooks/) - - !> Deprecated: Use the `onCall.OutgoingWebhook` data source instead. - - - :param str name: The action name. - """ - __args__ = dict() - __args__['name'] = name - opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) - __ret__ = pulumi.runtime.invoke('grafana:onCall/getAction:getAction', __args__, opts=opts, typ=GetActionResult).value - - return AwaitableGetActionResult( - id=pulumi.get(__ret__, 'id'), - name=pulumi.get(__ret__, 'name')) - - -@_utilities.lift_output_func(get_action) -def get_action_output(name: Optional[pulumi.Input[str]] = None, - opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetActionResult]: - """ - **Note:** This data source is going to be deprecated, please use outgoing webhook data source instead. - * [HTTP API](https://grafana.com/docs/oncall/latest/oncall-api-reference/outgoing_webhooks/) - - !> Deprecated: Use the `onCall.OutgoingWebhook` data source instead. - - - :param str name: The action name. - """ - ... diff --git a/sdk/python/pulumiverse_grafana/organization_preference.py b/sdk/python/pulumiverse_grafana/organization_preference.py deleted file mode 100644 index 4332b7f6..00000000 --- a/sdk/python/pulumiverse_grafana/organization_preference.py +++ /dev/null @@ -1,406 +0,0 @@ -# coding=utf-8 -# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** -# *** Do not edit by hand unless you're certain you know what you are doing! *** - -import copy -import warnings -import pulumi -import pulumi.runtime -from typing import Any, Mapping, Optional, Sequence, Union, overload -from . import _utilities - -__all__ = ['OrganizationPreferenceArgs', 'OrganizationPreference'] - -@pulumi.input_type -class OrganizationPreferenceArgs: - def __init__(__self__, *, - home_dashboard_id: Optional[pulumi.Input[int]] = None, - home_dashboard_uid: Optional[pulumi.Input[str]] = None, - org_id: Optional[pulumi.Input[str]] = None, - theme: Optional[pulumi.Input[str]] = None, - timezone: Optional[pulumi.Input[str]] = None, - week_start: Optional[pulumi.Input[str]] = None): - """ - The set of arguments for constructing a OrganizationPreference resource. - :param pulumi.Input[int] home_dashboard_id: The Organization home dashboard ID. Deprecated: Use `home_dashboard_uid` instead. - :param pulumi.Input[str] home_dashboard_uid: The Organization home dashboard UID. This is only available in Grafana 9.0+. - :param pulumi.Input[str] org_id: The Organization ID. If not set, the Org ID defined in the provider block will be used. - :param pulumi.Input[str] theme: The Organization theme. Available values are `light`, `dark`, `system`, or an empty string for the default. - :param pulumi.Input[str] timezone: The Organization timezone. Available values are `utc`, `browser`, or an empty string for the default. - :param pulumi.Input[str] week_start: The Organization week start day. Available values are `sunday`, `monday`, `saturday`, or an empty string for the - default. - """ - if home_dashboard_id is not None: - warnings.warn("""Use `home_dashboard_uid` instead.""", DeprecationWarning) - pulumi.log.warn("""home_dashboard_id is deprecated: Use `home_dashboard_uid` instead.""") - if home_dashboard_id is not None: - pulumi.set(__self__, "home_dashboard_id", home_dashboard_id) - if home_dashboard_uid is not None: - pulumi.set(__self__, "home_dashboard_uid", home_dashboard_uid) - if org_id is not None: - pulumi.set(__self__, "org_id", org_id) - if theme is not None: - pulumi.set(__self__, "theme", theme) - if timezone is not None: - pulumi.set(__self__, "timezone", timezone) - if week_start is not None: - pulumi.set(__self__, "week_start", week_start) - - @property - @pulumi.getter(name="homeDashboardId") - def home_dashboard_id(self) -> Optional[pulumi.Input[int]]: - """ - The Organization home dashboard ID. Deprecated: Use `home_dashboard_uid` instead. - """ - warnings.warn("""Use `home_dashboard_uid` instead.""", DeprecationWarning) - pulumi.log.warn("""home_dashboard_id is deprecated: Use `home_dashboard_uid` instead.""") - - return pulumi.get(self, "home_dashboard_id") - - @home_dashboard_id.setter - def home_dashboard_id(self, value: Optional[pulumi.Input[int]]): - pulumi.set(self, "home_dashboard_id", value) - - @property - @pulumi.getter(name="homeDashboardUid") - def home_dashboard_uid(self) -> Optional[pulumi.Input[str]]: - """ - The Organization home dashboard UID. This is only available in Grafana 9.0+. - """ - return pulumi.get(self, "home_dashboard_uid") - - @home_dashboard_uid.setter - def home_dashboard_uid(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "home_dashboard_uid", value) - - @property - @pulumi.getter(name="orgId") - def org_id(self) -> Optional[pulumi.Input[str]]: - """ - The Organization ID. If not set, the Org ID defined in the provider block will be used. - """ - return pulumi.get(self, "org_id") - - @org_id.setter - def org_id(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "org_id", value) - - @property - @pulumi.getter - def theme(self) -> Optional[pulumi.Input[str]]: - """ - The Organization theme. Available values are `light`, `dark`, `system`, or an empty string for the default. - """ - return pulumi.get(self, "theme") - - @theme.setter - def theme(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "theme", value) - - @property - @pulumi.getter - def timezone(self) -> Optional[pulumi.Input[str]]: - """ - The Organization timezone. Available values are `utc`, `browser`, or an empty string for the default. - """ - return pulumi.get(self, "timezone") - - @timezone.setter - def timezone(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "timezone", value) - - @property - @pulumi.getter(name="weekStart") - def week_start(self) -> Optional[pulumi.Input[str]]: - """ - The Organization week start day. Available values are `sunday`, `monday`, `saturday`, or an empty string for the - default. - """ - return pulumi.get(self, "week_start") - - @week_start.setter - def week_start(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "week_start", value) - - -@pulumi.input_type -class _OrganizationPreferenceState: - def __init__(__self__, *, - home_dashboard_id: Optional[pulumi.Input[int]] = None, - home_dashboard_uid: Optional[pulumi.Input[str]] = None, - org_id: Optional[pulumi.Input[str]] = None, - theme: Optional[pulumi.Input[str]] = None, - timezone: Optional[pulumi.Input[str]] = None, - week_start: Optional[pulumi.Input[str]] = None): - """ - Input properties used for looking up and filtering OrganizationPreference resources. - :param pulumi.Input[int] home_dashboard_id: The Organization home dashboard ID. Deprecated: Use `home_dashboard_uid` instead. - :param pulumi.Input[str] home_dashboard_uid: The Organization home dashboard UID. This is only available in Grafana 9.0+. - :param pulumi.Input[str] org_id: The Organization ID. If not set, the Org ID defined in the provider block will be used. - :param pulumi.Input[str] theme: The Organization theme. Available values are `light`, `dark`, `system`, or an empty string for the default. - :param pulumi.Input[str] timezone: The Organization timezone. Available values are `utc`, `browser`, or an empty string for the default. - :param pulumi.Input[str] week_start: The Organization week start day. Available values are `sunday`, `monday`, `saturday`, or an empty string for the - default. - """ - if home_dashboard_id is not None: - warnings.warn("""Use `home_dashboard_uid` instead.""", DeprecationWarning) - pulumi.log.warn("""home_dashboard_id is deprecated: Use `home_dashboard_uid` instead.""") - if home_dashboard_id is not None: - pulumi.set(__self__, "home_dashboard_id", home_dashboard_id) - if home_dashboard_uid is not None: - pulumi.set(__self__, "home_dashboard_uid", home_dashboard_uid) - if org_id is not None: - pulumi.set(__self__, "org_id", org_id) - if theme is not None: - pulumi.set(__self__, "theme", theme) - if timezone is not None: - pulumi.set(__self__, "timezone", timezone) - if week_start is not None: - pulumi.set(__self__, "week_start", week_start) - - @property - @pulumi.getter(name="homeDashboardId") - def home_dashboard_id(self) -> Optional[pulumi.Input[int]]: - """ - The Organization home dashboard ID. Deprecated: Use `home_dashboard_uid` instead. - """ - warnings.warn("""Use `home_dashboard_uid` instead.""", DeprecationWarning) - pulumi.log.warn("""home_dashboard_id is deprecated: Use `home_dashboard_uid` instead.""") - - return pulumi.get(self, "home_dashboard_id") - - @home_dashboard_id.setter - def home_dashboard_id(self, value: Optional[pulumi.Input[int]]): - pulumi.set(self, "home_dashboard_id", value) - - @property - @pulumi.getter(name="homeDashboardUid") - def home_dashboard_uid(self) -> Optional[pulumi.Input[str]]: - """ - The Organization home dashboard UID. This is only available in Grafana 9.0+. - """ - return pulumi.get(self, "home_dashboard_uid") - - @home_dashboard_uid.setter - def home_dashboard_uid(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "home_dashboard_uid", value) - - @property - @pulumi.getter(name="orgId") - def org_id(self) -> Optional[pulumi.Input[str]]: - """ - The Organization ID. If not set, the Org ID defined in the provider block will be used. - """ - return pulumi.get(self, "org_id") - - @org_id.setter - def org_id(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "org_id", value) - - @property - @pulumi.getter - def theme(self) -> Optional[pulumi.Input[str]]: - """ - The Organization theme. Available values are `light`, `dark`, `system`, or an empty string for the default. - """ - return pulumi.get(self, "theme") - - @theme.setter - def theme(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "theme", value) - - @property - @pulumi.getter - def timezone(self) -> Optional[pulumi.Input[str]]: - """ - The Organization timezone. Available values are `utc`, `browser`, or an empty string for the default. - """ - return pulumi.get(self, "timezone") - - @timezone.setter - def timezone(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "timezone", value) - - @property - @pulumi.getter(name="weekStart") - def week_start(self) -> Optional[pulumi.Input[str]]: - """ - The Organization week start day. Available values are `sunday`, `monday`, `saturday`, or an empty string for the - default. - """ - return pulumi.get(self, "week_start") - - @week_start.setter - def week_start(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "week_start", value) - - -warnings.warn("""grafana.index/organizationpreference.OrganizationPreference has been deprecated in favor of grafana.index/organizationpreferences.OrganizationPreferences""", DeprecationWarning) - - -class OrganizationPreference(pulumi.CustomResource): - warnings.warn("""grafana.index/organizationpreference.OrganizationPreference has been deprecated in favor of grafana.index/organizationpreferences.OrganizationPreferences""", DeprecationWarning) - - @overload - def __init__(__self__, - resource_name: str, - opts: Optional[pulumi.ResourceOptions] = None, - home_dashboard_id: Optional[pulumi.Input[int]] = None, - home_dashboard_uid: Optional[pulumi.Input[str]] = None, - org_id: Optional[pulumi.Input[str]] = None, - theme: Optional[pulumi.Input[str]] = None, - timezone: Optional[pulumi.Input[str]] = None, - week_start: Optional[pulumi.Input[str]] = None, - __props__=None): - """ - Create a OrganizationPreference resource with the given unique name, props, and options. - :param str resource_name: The name of the resource. - :param pulumi.ResourceOptions opts: Options for the resource. - :param pulumi.Input[int] home_dashboard_id: The Organization home dashboard ID. Deprecated: Use `home_dashboard_uid` instead. - :param pulumi.Input[str] home_dashboard_uid: The Organization home dashboard UID. This is only available in Grafana 9.0+. - :param pulumi.Input[str] org_id: The Organization ID. If not set, the Org ID defined in the provider block will be used. - :param pulumi.Input[str] theme: The Organization theme. Available values are `light`, `dark`, `system`, or an empty string for the default. - :param pulumi.Input[str] timezone: The Organization timezone. Available values are `utc`, `browser`, or an empty string for the default. - :param pulumi.Input[str] week_start: The Organization week start day. Available values are `sunday`, `monday`, `saturday`, or an empty string for the - default. - """ - ... - @overload - def __init__(__self__, - resource_name: str, - args: Optional[OrganizationPreferenceArgs] = None, - opts: Optional[pulumi.ResourceOptions] = None): - """ - Create a OrganizationPreference resource with the given unique name, props, and options. - :param str resource_name: The name of the resource. - :param OrganizationPreferenceArgs args: The arguments to use to populate this resource's properties. - :param pulumi.ResourceOptions opts: Options for the resource. - """ - ... - def __init__(__self__, resource_name: str, *args, **kwargs): - resource_args, opts = _utilities.get_resource_args_opts(OrganizationPreferenceArgs, pulumi.ResourceOptions, *args, **kwargs) - if resource_args is not None: - __self__._internal_init(resource_name, opts, **resource_args.__dict__) - else: - __self__._internal_init(resource_name, *args, **kwargs) - - def _internal_init(__self__, - resource_name: str, - opts: Optional[pulumi.ResourceOptions] = None, - home_dashboard_id: Optional[pulumi.Input[int]] = None, - home_dashboard_uid: Optional[pulumi.Input[str]] = None, - org_id: Optional[pulumi.Input[str]] = None, - theme: Optional[pulumi.Input[str]] = None, - timezone: Optional[pulumi.Input[str]] = None, - week_start: Optional[pulumi.Input[str]] = None, - __props__=None): - pulumi.log.warn("""OrganizationPreference is deprecated: grafana.index/organizationpreference.OrganizationPreference has been deprecated in favor of grafana.index/organizationpreferences.OrganizationPreferences""") - opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) - if not isinstance(opts, pulumi.ResourceOptions): - raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.id is None: - if __props__ is not None: - raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') - __props__ = OrganizationPreferenceArgs.__new__(OrganizationPreferenceArgs) - - __props__.__dict__["home_dashboard_id"] = home_dashboard_id - __props__.__dict__["home_dashboard_uid"] = home_dashboard_uid - __props__.__dict__["org_id"] = org_id - __props__.__dict__["theme"] = theme - __props__.__dict__["timezone"] = timezone - __props__.__dict__["week_start"] = week_start - super(OrganizationPreference, __self__).__init__( - 'grafana:index/organizationPreference:OrganizationPreference', - resource_name, - __props__, - opts) - - @staticmethod - def get(resource_name: str, - id: pulumi.Input[str], - opts: Optional[pulumi.ResourceOptions] = None, - home_dashboard_id: Optional[pulumi.Input[int]] = None, - home_dashboard_uid: Optional[pulumi.Input[str]] = None, - org_id: Optional[pulumi.Input[str]] = None, - theme: Optional[pulumi.Input[str]] = None, - timezone: Optional[pulumi.Input[str]] = None, - week_start: Optional[pulumi.Input[str]] = None) -> 'OrganizationPreference': - """ - Get an existing OrganizationPreference resource's state with the given name, id, and optional extra - properties used to qualify the lookup. - - :param str resource_name: The unique name of the resulting resource. - :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. - :param pulumi.ResourceOptions opts: Options for the resource. - :param pulumi.Input[int] home_dashboard_id: The Organization home dashboard ID. Deprecated: Use `home_dashboard_uid` instead. - :param pulumi.Input[str] home_dashboard_uid: The Organization home dashboard UID. This is only available in Grafana 9.0+. - :param pulumi.Input[str] org_id: The Organization ID. If not set, the Org ID defined in the provider block will be used. - :param pulumi.Input[str] theme: The Organization theme. Available values are `light`, `dark`, `system`, or an empty string for the default. - :param pulumi.Input[str] timezone: The Organization timezone. Available values are `utc`, `browser`, or an empty string for the default. - :param pulumi.Input[str] week_start: The Organization week start day. Available values are `sunday`, `monday`, `saturday`, or an empty string for the - default. - """ - opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) - - __props__ = _OrganizationPreferenceState.__new__(_OrganizationPreferenceState) - - __props__.__dict__["home_dashboard_id"] = home_dashboard_id - __props__.__dict__["home_dashboard_uid"] = home_dashboard_uid - __props__.__dict__["org_id"] = org_id - __props__.__dict__["theme"] = theme - __props__.__dict__["timezone"] = timezone - __props__.__dict__["week_start"] = week_start - return OrganizationPreference(resource_name, opts=opts, __props__=__props__) - - @property - @pulumi.getter(name="homeDashboardId") - def home_dashboard_id(self) -> pulumi.Output[Optional[int]]: - """ - The Organization home dashboard ID. Deprecated: Use `home_dashboard_uid` instead. - """ - warnings.warn("""Use `home_dashboard_uid` instead.""", DeprecationWarning) - pulumi.log.warn("""home_dashboard_id is deprecated: Use `home_dashboard_uid` instead.""") - - return pulumi.get(self, "home_dashboard_id") - - @property - @pulumi.getter(name="homeDashboardUid") - def home_dashboard_uid(self) -> pulumi.Output[Optional[str]]: - """ - The Organization home dashboard UID. This is only available in Grafana 9.0+. - """ - return pulumi.get(self, "home_dashboard_uid") - - @property - @pulumi.getter(name="orgId") - def org_id(self) -> pulumi.Output[Optional[str]]: - """ - The Organization ID. If not set, the Org ID defined in the provider block will be used. - """ - return pulumi.get(self, "org_id") - - @property - @pulumi.getter - def theme(self) -> pulumi.Output[Optional[str]]: - """ - The Organization theme. Available values are `light`, `dark`, `system`, or an empty string for the default. - """ - return pulumi.get(self, "theme") - - @property - @pulumi.getter - def timezone(self) -> pulumi.Output[Optional[str]]: - """ - The Organization timezone. Available values are `utc`, `browser`, or an empty string for the default. - """ - return pulumi.get(self, "timezone") - - @property - @pulumi.getter(name="weekStart") - def week_start(self) -> pulumi.Output[Optional[str]]: - """ - The Organization week start day. Available values are `sunday`, `monday`, `saturday`, or an empty string for the - default. - """ - return pulumi.get(self, "week_start") - diff --git a/sdk/python/pulumiverse_grafana/oss/api_key.py b/sdk/python/pulumiverse_grafana/oss/api_key.py deleted file mode 100644 index c522e9e2..00000000 --- a/sdk/python/pulumiverse_grafana/oss/api_key.py +++ /dev/null @@ -1,316 +0,0 @@ -# coding=utf-8 -# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** -# *** Do not edit by hand unless you're certain you know what you are doing! *** - -import copy -import warnings -import pulumi -import pulumi.runtime -from typing import Any, Mapping, Optional, Sequence, Union, overload -from .. import _utilities - -__all__ = ['ApiKeyArgs', 'ApiKey'] - -@pulumi.input_type -class ApiKeyArgs: - def __init__(__self__, *, - role: pulumi.Input[str], - name: Optional[pulumi.Input[str]] = None, - org_id: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None): - """ - The set of arguments for constructing a ApiKey resource. - :param pulumi.Input[str] org_id: The Organization ID. If not set, the Org ID defined in the provider block will be used. - """ - pulumi.set(__self__, "role", role) - if name is not None: - pulumi.set(__self__, "name", name) - if org_id is not None: - pulumi.set(__self__, "org_id", org_id) - if seconds_to_live is not None: - pulumi.set(__self__, "seconds_to_live", seconds_to_live) - - @property - @pulumi.getter - def role(self) -> pulumi.Input[str]: - return pulumi.get(self, "role") - - @role.setter - def role(self, value: pulumi.Input[str]): - pulumi.set(self, "role", value) - - @property - @pulumi.getter - def name(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "name") - - @name.setter - def name(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "name", value) - - @property - @pulumi.getter(name="orgId") - def org_id(self) -> Optional[pulumi.Input[str]]: - """ - The Organization ID. If not set, the Org ID defined in the provider block will be used. - """ - return pulumi.get(self, "org_id") - - @org_id.setter - def org_id(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "org_id", value) - - @property - @pulumi.getter(name="secondsToLive") - def seconds_to_live(self) -> Optional[pulumi.Input[int]]: - return pulumi.get(self, "seconds_to_live") - - @seconds_to_live.setter - def seconds_to_live(self, value: Optional[pulumi.Input[int]]): - pulumi.set(self, "seconds_to_live", value) - - -@pulumi.input_type -class _ApiKeyState: - def __init__(__self__, *, - expiration: Optional[pulumi.Input[str]] = None, - key: Optional[pulumi.Input[str]] = None, - name: Optional[pulumi.Input[str]] = None, - org_id: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None): - """ - Input properties used for looking up and filtering ApiKey resources. - :param pulumi.Input[str] org_id: The Organization ID. If not set, the Org ID defined in the provider block will be used. - """ - if expiration is not None: - pulumi.set(__self__, "expiration", expiration) - if key is not None: - pulumi.set(__self__, "key", key) - if name is not None: - pulumi.set(__self__, "name", name) - if org_id is not None: - pulumi.set(__self__, "org_id", org_id) - if role is not None: - pulumi.set(__self__, "role", role) - if seconds_to_live is not None: - pulumi.set(__self__, "seconds_to_live", seconds_to_live) - - @property - @pulumi.getter - def expiration(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "expiration") - - @expiration.setter - def expiration(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "expiration", value) - - @property - @pulumi.getter - def key(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "key") - - @key.setter - def key(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "key", value) - - @property - @pulumi.getter - def name(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "name") - - @name.setter - def name(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "name", value) - - @property - @pulumi.getter(name="orgId") - def org_id(self) -> Optional[pulumi.Input[str]]: - """ - The Organization ID. If not set, the Org ID defined in the provider block will be used. - """ - return pulumi.get(self, "org_id") - - @org_id.setter - def org_id(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "org_id", value) - - @property - @pulumi.getter - def role(self) -> Optional[pulumi.Input[str]]: - return pulumi.get(self, "role") - - @role.setter - def role(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "role", value) - - @property - @pulumi.getter(name="secondsToLive") - def seconds_to_live(self) -> Optional[pulumi.Input[int]]: - return pulumi.get(self, "seconds_to_live") - - @seconds_to_live.setter - def seconds_to_live(self, value: Optional[pulumi.Input[int]]): - pulumi.set(self, "seconds_to_live", value) - - -class ApiKey(pulumi.CustomResource): - @overload - def __init__(__self__, - resource_name: str, - opts: Optional[pulumi.ResourceOptions] = None, - name: Optional[pulumi.Input[str]] = None, - org_id: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None, - __props__=None): - """ - ## Example Usage - - ```python - import pulumi - import pulumiverse_grafana as grafana - - foo = grafana.oss.ApiKey("foo", role="Viewer") - bar = grafana.oss.ApiKey("bar", - role="Admin", - seconds_to_live=30) - pulumi.export("apiKeyFooKeyOnly", foo.key) - pulumi.export("apiKeyBar", bar) - ``` - - :param str resource_name: The name of the resource. - :param pulumi.ResourceOptions opts: Options for the resource. - :param pulumi.Input[str] org_id: The Organization ID. If not set, the Org ID defined in the provider block will be used. - """ - ... - @overload - def __init__(__self__, - resource_name: str, - args: ApiKeyArgs, - opts: Optional[pulumi.ResourceOptions] = None): - """ - ## Example Usage - - ```python - import pulumi - import pulumiverse_grafana as grafana - - foo = grafana.oss.ApiKey("foo", role="Viewer") - bar = grafana.oss.ApiKey("bar", - role="Admin", - seconds_to_live=30) - pulumi.export("apiKeyFooKeyOnly", foo.key) - pulumi.export("apiKeyBar", bar) - ``` - - :param str resource_name: The name of the resource. - :param ApiKeyArgs args: The arguments to use to populate this resource's properties. - :param pulumi.ResourceOptions opts: Options for the resource. - """ - ... - def __init__(__self__, resource_name: str, *args, **kwargs): - resource_args, opts = _utilities.get_resource_args_opts(ApiKeyArgs, pulumi.ResourceOptions, *args, **kwargs) - if resource_args is not None: - __self__._internal_init(resource_name, opts, **resource_args.__dict__) - else: - __self__._internal_init(resource_name, *args, **kwargs) - - def _internal_init(__self__, - resource_name: str, - opts: Optional[pulumi.ResourceOptions] = None, - name: Optional[pulumi.Input[str]] = None, - org_id: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None, - __props__=None): - opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) - if not isinstance(opts, pulumi.ResourceOptions): - raise TypeError('Expected resource options to be a ResourceOptions instance') - if opts.id is None: - if __props__ is not None: - raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') - __props__ = ApiKeyArgs.__new__(ApiKeyArgs) - - __props__.__dict__["name"] = name - __props__.__dict__["org_id"] = org_id - if role is None and not opts.urn: - raise TypeError("Missing required property 'role'") - __props__.__dict__["role"] = role - __props__.__dict__["seconds_to_live"] = seconds_to_live - __props__.__dict__["expiration"] = None - __props__.__dict__["key"] = None - alias_opts = pulumi.ResourceOptions(aliases=[pulumi.Alias(type_="grafana:index/apiKey:ApiKey")]) - opts = pulumi.ResourceOptions.merge(opts, alias_opts) - secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["key"]) - opts = pulumi.ResourceOptions.merge(opts, secret_opts) - super(ApiKey, __self__).__init__( - 'grafana:oss/apiKey:ApiKey', - resource_name, - __props__, - opts) - - @staticmethod - def get(resource_name: str, - id: pulumi.Input[str], - opts: Optional[pulumi.ResourceOptions] = None, - expiration: Optional[pulumi.Input[str]] = None, - key: Optional[pulumi.Input[str]] = None, - name: Optional[pulumi.Input[str]] = None, - org_id: Optional[pulumi.Input[str]] = None, - role: Optional[pulumi.Input[str]] = None, - seconds_to_live: Optional[pulumi.Input[int]] = None) -> 'ApiKey': - """ - Get an existing ApiKey resource's state with the given name, id, and optional extra - properties used to qualify the lookup. - - :param str resource_name: The unique name of the resulting resource. - :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. - :param pulumi.ResourceOptions opts: Options for the resource. - :param pulumi.Input[str] org_id: The Organization ID. If not set, the Org ID defined in the provider block will be used. - """ - opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) - - __props__ = _ApiKeyState.__new__(_ApiKeyState) - - __props__.__dict__["expiration"] = expiration - __props__.__dict__["key"] = key - __props__.__dict__["name"] = name - __props__.__dict__["org_id"] = org_id - __props__.__dict__["role"] = role - __props__.__dict__["seconds_to_live"] = seconds_to_live - return ApiKey(resource_name, opts=opts, __props__=__props__) - - @property - @pulumi.getter - def expiration(self) -> pulumi.Output[str]: - return pulumi.get(self, "expiration") - - @property - @pulumi.getter - def key(self) -> pulumi.Output[str]: - return pulumi.get(self, "key") - - @property - @pulumi.getter - def name(self) -> pulumi.Output[str]: - return pulumi.get(self, "name") - - @property - @pulumi.getter(name="orgId") - def org_id(self) -> pulumi.Output[Optional[str]]: - """ - The Organization ID. If not set, the Org ID defined in the provider block will be used. - """ - return pulumi.get(self, "org_id") - - @property - @pulumi.getter - def role(self) -> pulumi.Output[str]: - return pulumi.get(self, "role") - - @property - @pulumi.getter(name="secondsToLive") - def seconds_to_live(self) -> pulumi.Output[Optional[int]]: - return pulumi.get(self, "seconds_to_live") - diff --git a/sdk/python/pyproject.toml b/sdk/python/pyproject.toml new file mode 100644 index 00000000..c3185f72 --- /dev/null +++ b/sdk/python/pyproject.toml @@ -0,0 +1,22 @@ +[project] + name = "pulumiverse_grafana" + description = "A Pulumi package for creating and managing grafana." + dependencies = ["parver>=0.2.1", "pulumi>=3.0.0,<4.0.0", "semver>=2.8.1"] + keywords = ["pulumi", "grafana", "pulumiverse"] + readme = "README.md" + requires-python = ">=3.8" + version = "0.0.0" + [project.license] + text = "Apache-2.0" + [project.urls] + Homepage = "https://grafana.com" + Repository = "https://github.com/pulumiverse/pulumi-grafana" + +[build-system] + requires = ["setuptools>=61.0"] + build-backend = "setuptools.build_meta" + +[tool] + [tool.setuptools] + [tool.setuptools.package-data] + pulumiverse_grafana = ["py.typed", "pulumi-plugin.json"] diff --git a/sdk/python/setup.py b/sdk/python/setup.py deleted file mode 100644 index a811f435..00000000 --- a/sdk/python/setup.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** -# *** Do not edit by hand unless you're certain you know what you are doing! *** - -import errno -from setuptools import setup, find_packages -from setuptools.command.install import install -from subprocess import check_call - - -VERSION = "0.0.0" -def readme(): - try: - with open('README.md', encoding='utf-8') as f: - return f.read() - except FileNotFoundError: - return "grafana Pulumi Package - Development Version" - - -setup(name='pulumiverse_grafana', - python_requires='>=3.8', - version=VERSION, - description="A Pulumi package for creating and managing grafana.", - long_description=readme(), - long_description_content_type='text/markdown', - keywords='pulumi grafana pulumiverse', - url='https://grafana.com', - project_urls={ - 'Repository': 'https://github.com/pulumiverse/pulumi-grafana' - }, - license='Apache-2.0', - packages=find_packages(), - package_data={ - 'pulumiverse_grafana': [ - 'py.typed', - 'pulumi-plugin.json', - ] - }, - install_requires=[ - 'parver>=0.2.1', - 'pulumi>=3.0.0,<4.0.0', - 'semver>=2.8.1' - ], - zip_safe=False)