From 023bb22eaccc3c01b7d9f75f2d088c7c05abfae5 Mon Sep 17 00:00:00 2001 From: Thulasiraj Komminar <39799163+thulasirajkomminar@users.noreply.github.com> Date: Wed, 21 Aug 2024 19:58:35 +0200 Subject: [PATCH] added support for `partition_template` --- CHANGELOG.md | 13 + Makefile | 2 +- docs/_index.md | 4 + .../bridge-metadata.json | 23 +- .../schema-embed.json | 2 +- .../cmd/pulumi-resource-influxdb3/schema.json | 107 +++++- provider/go.mod | 2 +- provider/go.sum | 4 +- provider/shim/go.mod | 2 +- provider/shim/go.sum | 4 +- sdk/dotnet/Database.cs | 82 ++++- sdk/dotnet/GetDatabase.cs | 7 + .../Inputs/DatabasePartitionTemplateArgs.cs | 33 ++ .../DatabasePartitionTemplateGetArgs.cs | 33 ++ .../Outputs/DatabasePartitionTemplate.cs | 36 ++ .../GetDatabasePartitionTemplateResult.cs | 36 ++ ...atabasesDatabasePartitionTemplateResult.cs | 36 ++ .../Outputs/GetDatabasesDatabaseResult.cs | 7 + sdk/dotnet/version.txt | 2 +- sdk/go/influxdb3/database.go | 81 ++++- sdk/go/influxdb3/getDatabase.go | 7 + sdk/go/influxdb3/pulumiTypes.go | 339 ++++++++++++++++++ sdk/nodejs/database.ts | 54 ++- sdk/nodejs/getDatabase.ts | 6 + sdk/nodejs/types/input.ts | 11 + sdk/nodejs/types/output.ts | 37 ++ sdk/nodejs/yarn.lock | 22 +- sdk/python/komminarlabs_influxdb3/_inputs.py | 38 ++ sdk/python/komminarlabs_influxdb3/database.py | 127 ++++++- .../komminarlabs_influxdb3/get_database.py | 16 +- sdk/python/komminarlabs_influxdb3/outputs.py | 101 ++++++ 31 files changed, 1227 insertions(+), 47 deletions(-) create mode 100644 sdk/dotnet/Inputs/DatabasePartitionTemplateArgs.cs create mode 100644 sdk/dotnet/Inputs/DatabasePartitionTemplateGetArgs.cs create mode 100644 sdk/dotnet/Outputs/DatabasePartitionTemplate.cs create mode 100644 sdk/dotnet/Outputs/GetDatabasePartitionTemplateResult.cs create mode 100644 sdk/dotnet/Outputs/GetDatabasesDatabasePartitionTemplateResult.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f8c38c..bdf1483 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,19 @@ CHANGELOG ========= +## [1.2.1] - 2024-08-21 + +### Added: + +* Added [partition_template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) support. **Note:** Database and table partitions can only be defined on create. You [cannot update the partition strategy](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) of a database or table after it has been created. An update will result in resource replacement. + +## [1.0.1] - 2024-08-13 + +### Updated: + +- Support new [terraform provider version](https://github.com/komminarlabs/terraform-provider-influxdb3/releases/tag/v1.0.1). +- Updated readme + ## [1.0.0] - 2024-08-05 Initial release of the provider diff --git a/Makefile b/Makefile index f67a2be..9211e0c 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ PROJECT := github.com/komminarlabs/pulumi-influxdb3 NODE_MODULE_NAME := @komminarlabs/influxdb3 TF_NAME := influxdb3 PROVIDER_PATH := provider -PROVIDER_VERSION := 1.0.1 +PROVIDER_VERSION := 1.2.1 VERSION_PATH := ${PROVIDER_PATH}/pkg/version.Version TFGEN := pulumi-tfgen-influxdb3 diff --git a/docs/_index.md b/docs/_index.md index a88fb81..ef42b0d 100644 --- a/docs/_index.md +++ b/docs/_index.md @@ -8,6 +8,10 @@ The InfluxDB V3 provider for Pulumi can be used to provision the resources avail The InfluxDB V3 provider must be configured with credentials to deploy and update resources in InfluxDB; see [Installation & Configuration](./installation-configuration) for instructions. +## Supported InfluxDB flavours + +* [InfluxDB Cloud Dedicated](https://www.influxdata.com/products/influxdb-cloud/dedicated/) + ## Example {{< chooser language "typescript,python,go" >}} diff --git a/provider/cmd/pulumi-resource-influxdb3/bridge-metadata.json b/provider/cmd/pulumi-resource-influxdb3/bridge-metadata.json index c61bd4d..654671c 100644 --- a/provider/cmd/pulumi-resource-influxdb3/bridge-metadata.json +++ b/provider/cmd/pulumi-resource-influxdb3/bridge-metadata.json @@ -3,7 +3,12 @@ "resources": { "influxdb3_database": { "current": "influxdb3:index/database:Database", - "majorVersion": 1 + "majorVersion": 1, + "fields": { + "partition_template": { + "maxItemsOne": false + } + } }, "influxdb3_token": { "current": "influxdb3:index/token:Token", @@ -18,14 +23,26 @@ "datasources": { "influxdb3_database": { "current": "influxdb3:index/getDatabase:getDatabase", - "majorVersion": 1 + "majorVersion": 1, + "fields": { + "partition_template": { + "maxItemsOne": false + } + } }, "influxdb3_databases": { "current": "influxdb3:index/getDatabases:getDatabases", "majorVersion": 1, "fields": { "databases": { - "maxItemsOne": false + "maxItemsOne": false, + "elem": { + "fields": { + "partition_template": { + "maxItemsOne": false + } + } + } } } }, diff --git a/provider/cmd/pulumi-resource-influxdb3/schema-embed.json b/provider/cmd/pulumi-resource-influxdb3/schema-embed.json index 4ce965b..446ab79 100644 --- a/provider/cmd/pulumi-resource-influxdb3/schema-embed.json +++ b/provider/cmd/pulumi-resource-influxdb3/schema-embed.json @@ -1 +1 @@ -{"name":"influxdb3","displayName":"InfluxDB3","version":"1.0.0+dirty","description":"A Pulumi package for creating and managing InfluxDB V3 resources.","keywords":["pulumi","influxdb3","category/database"],"homepage":"https://www.influxdata.com","license":"Apache-2.0","attribution":"This Pulumi package is based on the [`influxdb3` Terraform Provider](https://github.com/komminarlabs/terraform-provider-influxdb3).","repository":"https://github.com/komminarlabs/pulumi-influxdb3","logoUrl":"https://avatars.githubusercontent.com/u/5713248?s=200\u0026v=4","pluginDownloadURL":"github://api.github.com/komminarlabs","publisher":"komminarlabs","meta":{"moduleFormat":"(.*)(?:/[^/]*)"},"language":{"csharp":{"packageReferences":{"Pulumi":"3.*"},"namespaces":{"influxdb3":"InfluxDB3"},"compatibility":"tfbridge20","rootNamespace":"KomminarLabs"},"go":{"importBasePath":"github.com/komminarlabs/pulumi-influxdb3/sdk/go/influxdb3","generateResourceContainerTypes":true,"generateExtraInputTypes":true},"nodejs":{"packageName":"@komminarlabs/influxdb3","packageDescription":"A Pulumi package for creating and managing InfluxDB V3 resources.","readme":"\u003e This provider is a derived work of the [Terraform Provider](https://github.com/komminarlabs/terraform-provider-influxdb3)\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-influxdb3` repo](https://github.com/komminarlabs/pulumi-influxdb3/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-influxdb3` repo](https://github.com/komminarlabs/terraform-provider-influxdb3/issues).","dependencies":{"@pulumi/pulumi":"^3.0.0"},"devDependencies":{"@types/mime":"^2.0.0","@types/node":"^10.0.0"},"compatibility":"tfbridge20","disableUnionOutputTypes":true},"python":{"packageName":"komminarlabs_influxdb3","requires":{"pulumi":"\u003e=3.0.0,\u003c4.0.0"},"readme":"\u003e This provider is a derived work of the [Terraform Provider](https://github.com/komminarlabs/terraform-provider-influxdb3)\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-influxdb3` repo](https://github.com/komminarlabs/pulumi-influxdb3/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-influxdb3` repo](https://github.com/komminarlabs/terraform-provider-influxdb3/issues).","compatibility":"tfbridge20","pyproject":{}}},"config":{"variables":{"accountId":{"type":"string","description":"The ID of the account that the cluster belongs to\n","secret":true},"clusterId":{"type":"string","description":"The ID of the cluster that you want to manage\n","secret":true},"token":{"type":"string","description":"The InfluxDB management token\n","secret":true},"url":{"type":"string","description":"The InfluxDB Cloud Dedicated Management API URL\n"}}},"types":{"influxdb3:index/TokenPermission:TokenPermission":{"properties":{"action":{"type":"string","description":"The action the database token permission allows. Valid values are `read` or `write`.\n"},"resource":{"type":"string","description":"The resource the database token permission applies to. `*` refers to all databases.\n"}},"type":"object","required":["action","resource"]},"influxdb3:index/getDatabasesDatabase:getDatabasesDatabase":{"properties":{"accountId":{"type":"string","description":"The ID of the account that the cluster belongs to.\n"},"clusterId":{"type":"string","description":"The ID of the cluster that you want to manage.\n"},"maxColumnsPerTable":{"type":"integer","description":"The maximum number of columns per table for the cluster database.\n"},"maxTables":{"type":"integer","description":"The maximum number of tables for the cluster database.\n"},"name":{"type":"string","description":"The name of the cluster database.\n"},"retentionPeriod":{"type":"integer","description":"The retention period of the cluster database in nanoseconds.\n"}},"type":"object","required":["accountId","clusterId","maxColumnsPerTable","maxTables","name","retentionPeriod"],"language":{"nodejs":{"requiredInputs":[]}}},"influxdb3:index/getTokenPermission:getTokenPermission":{"properties":{"action":{"type":"string","description":"The action the database token permission allows.\n"},"resource":{"type":"string","description":"The resource the database token permission applies to. `*` refers to all databases.\n"}},"type":"object","required":["action","resource"],"language":{"nodejs":{"requiredInputs":[]}}},"influxdb3:index/getTokensToken:getTokensToken":{"properties":{"accessToken":{"type":"string","description":"The access token that can be used to authenticate query and write requests to the cluster. The access token is never stored by InfluxDB and is only returned once when the token is created. If the access token is lost, a new token must be created.\n","secret":true},"accountId":{"type":"string","description":"The ID of the account that the database token belongs to.\n"},"clusterId":{"type":"string","description":"The ID of the cluster that the database token belongs to.\n"},"createdAt":{"type":"string","description":"The date and time that the database token was created. Uses RFC3339 format.\n"},"description":{"type":"string","description":"The description of the database token.\n"},"id":{"type":"string","description":"The ID of the database token.\n"},"permissions":{"type":"array","items":{"$ref":"#/types/influxdb3:index/getTokensTokenPermission:getTokensTokenPermission"},"description":"The list of permissions the database token allows.\n"}},"type":"object","required":["accessToken","accountId","clusterId","createdAt","description","id","permissions"],"language":{"nodejs":{"requiredInputs":[]}}},"influxdb3:index/getTokensTokenPermission:getTokensTokenPermission":{"properties":{"action":{"type":"string","description":"The action the database token permission allows.\n"},"resource":{"type":"string","description":"The resource the database token permission applies to. `*` refers to all databases.\n"}},"type":"object","required":["action","resource"],"language":{"nodejs":{"requiredInputs":[]}}}},"provider":{"description":"The provider type for the influxdb3 package. By default, resources use package-wide configuration\nsettings, however an explicit `Provider` instance may be created and passed during resource\nconstruction to achieve fine-grained programmatic control over provider settings. See the\n[documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.\n","properties":{"accountId":{"type":"string","description":"The ID of the account that the cluster belongs to\n","secret":true},"clusterId":{"type":"string","description":"The ID of the cluster that you want to manage\n","secret":true},"token":{"type":"string","description":"The InfluxDB management token\n","secret":true},"url":{"type":"string","description":"The InfluxDB Cloud Dedicated Management API URL\n"}},"inputProperties":{"accountId":{"type":"string","description":"The ID of the account that the cluster belongs to\n","secret":true},"clusterId":{"type":"string","description":"The ID of the cluster that you want to manage\n","secret":true},"token":{"type":"string","description":"The InfluxDB management token\n","secret":true},"url":{"type":"string","description":"The InfluxDB Cloud Dedicated Management API URL\n"}}},"resources":{"influxdb3:index/database:Database":{"description":"Creates and manages a database.\n","properties":{"accountId":{"type":"string","description":"The ID of the account that the cluster belongs to.\n"},"clusterId":{"type":"string","description":"The ID of the cluster that you want to manage.\n"},"maxColumnsPerTable":{"type":"integer","description":"The maximum number of columns per table for the cluster database. The default is `200`\n"},"maxTables":{"type":"integer","description":"The maximum number of tables for the cluster database. The default is `500`\n"},"name":{"type":"string","description":"The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database.\n"},"retentionPeriod":{"type":"integer","description":"The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention.\n"}},"required":["accountId","clusterId","maxColumnsPerTable","maxTables","name","retentionPeriod"],"inputProperties":{"maxColumnsPerTable":{"type":"integer","description":"The maximum number of columns per table for the cluster database. The default is `200`\n"},"maxTables":{"type":"integer","description":"The maximum number of tables for the cluster database. The default is `500`\n"},"name":{"type":"string","description":"The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database.\n"},"retentionPeriod":{"type":"integer","description":"The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention.\n"}},"stateInputs":{"description":"Input properties used for looking up and filtering Database resources.\n","properties":{"accountId":{"type":"string","description":"The ID of the account that the cluster belongs to.\n"},"clusterId":{"type":"string","description":"The ID of the cluster that you want to manage.\n"},"maxColumnsPerTable":{"type":"integer","description":"The maximum number of columns per table for the cluster database. The default is `200`\n"},"maxTables":{"type":"integer","description":"The maximum number of tables for the cluster database. The default is `500`\n"},"name":{"type":"string","description":"The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database.\n"},"retentionPeriod":{"type":"integer","description":"The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention.\n"}},"type":"object"}},"influxdb3:index/token:Token":{"description":"Creates and manages a token and returns the generated database token. Use this resource to create/manage a token, which generates an database token with permissions to read or write to a specific database.\n","properties":{"accessToken":{"type":"string","description":"The access token that can be used to authenticate query and write requests to the cluster. The access token is never stored by InfluxDB and is only returned once when the token is created. If the access token is lost, a new token must be created.\n","secret":true},"accountId":{"type":"string","description":"The ID of the account that the database token belongs to.\n"},"clusterId":{"type":"string","description":"The ID of the cluster that the database token belongs to.\n"},"createdAt":{"type":"string","description":"The date and time that the database token was created. Uses RFC3339 format.\n"},"description":{"type":"string","description":"The description of the database token.\n"},"permissions":{"type":"array","items":{"$ref":"#/types/influxdb3:index/TokenPermission:TokenPermission"},"description":"The list of permissions the database token allows.\n"}},"required":["accessToken","accountId","clusterId","createdAt","description","permissions"],"inputProperties":{"description":{"type":"string","description":"The description of the database token.\n"},"permissions":{"type":"array","items":{"$ref":"#/types/influxdb3:index/TokenPermission:TokenPermission"},"description":"The list of permissions the database token allows.\n"}},"requiredInputs":["description","permissions"],"stateInputs":{"description":"Input properties used for looking up and filtering Token resources.\n","properties":{"accessToken":{"type":"string","description":"The access token that can be used to authenticate query and write requests to the cluster. The access token is never stored by InfluxDB and is only returned once when the token is created. If the access token is lost, a new token must be created.\n","secret":true},"accountId":{"type":"string","description":"The ID of the account that the database token belongs to.\n"},"clusterId":{"type":"string","description":"The ID of the cluster that the database token belongs to.\n"},"createdAt":{"type":"string","description":"The date and time that the database token was created. Uses RFC3339 format.\n"},"description":{"type":"string","description":"The description of the database token.\n"},"permissions":{"type":"array","items":{"$ref":"#/types/influxdb3:index/TokenPermission:TokenPermission"},"description":"The list of permissions the database token allows.\n"}},"type":"object"}}},"functions":{"influxdb3:index/getDatabase:getDatabase":{"description":"Retrieves a database. Use this data source to retrieve information for a specific database.\n","inputs":{"description":"A collection of arguments for invoking getDatabase.\n","properties":{"name":{"type":"string","description":"The name of the cluster database.\n"}},"type":"object","required":["name"]},"outputs":{"description":"A collection of values returned by getDatabase.\n","properties":{"accountId":{"description":"The ID of the account that the cluster belongs to.\n","type":"string"},"clusterId":{"description":"The ID of the cluster that you want to manage.\n","type":"string"},"id":{"description":"The provider-assigned unique ID for this managed resource.\n","type":"string"},"maxColumnsPerTable":{"description":"The maximum number of columns per table for the cluster database.\n","type":"integer"},"maxTables":{"description":"The maximum number of tables for the cluster database.\n","type":"integer"},"name":{"description":"The name of the cluster database.\n","type":"string"},"retentionPeriod":{"description":"The retention period of the cluster database in nanoseconds.\n","type":"integer"}},"required":["accountId","clusterId","maxColumnsPerTable","maxTables","name","retentionPeriod","id"],"type":"object"}},"influxdb3:index/getDatabases:getDatabases":{"description":"Gets all databases for a cluster.\n","outputs":{"description":"A collection of values returned by getDatabases.\n","properties":{"databases":{"items":{"$ref":"#/types/influxdb3:index/getDatabasesDatabase:getDatabasesDatabase"},"type":"array"},"id":{"description":"The provider-assigned unique ID for this managed resource.\n","type":"string"}},"required":["databases","id"],"type":"object"}},"influxdb3:index/getToken:getToken":{"description":"Gets a database token. Use this data source to retrieve information about a database token, including the token's permissions.\n","inputs":{"description":"A collection of arguments for invoking getToken.\n","properties":{"id":{"type":"string","description":"The ID of the database token.\n"}},"type":"object","required":["id"]},"outputs":{"description":"A collection of values returned by getToken.\n","properties":{"accessToken":{"description":"The access token that can be used to authenticate query and write requests to the cluster. The access token is never stored by InfluxDB and is only returned once when the token is created. If the access token is lost, a new token must be created.\n","secret":true,"type":"string"},"accountId":{"description":"The ID of the account that the database token belongs to.\n","type":"string"},"clusterId":{"description":"The ID of the cluster that the database token belongs to.\n","type":"string"},"createdAt":{"description":"The date and time that the database token was created. Uses RFC3339 format.\n","type":"string"},"description":{"description":"The description of the database token.\n","type":"string"},"id":{"description":"The ID of the database token.\n","type":"string"},"permissions":{"description":"The list of permissions the database token allows.\n","items":{"$ref":"#/types/influxdb3:index/getTokenPermission:getTokenPermission"},"type":"array"}},"required":["accessToken","accountId","clusterId","createdAt","description","id","permissions"],"type":"object"}},"influxdb3:index/getTokens:getTokens":{"description":"Gets all database tokens for a cluster.\n","outputs":{"description":"A collection of values returned by getTokens.\n","properties":{"id":{"description":"The provider-assigned unique ID for this managed resource.\n","type":"string"},"tokens":{"items":{"$ref":"#/types/influxdb3:index/getTokensToken:getTokensToken"},"type":"array"}},"required":["tokens","id"],"type":"object"}}}} \ No newline at end of file +{"name":"influxdb3","displayName":"InfluxDB3","version":"1.1.0-alpha.1723580008+1a720995.dirty","description":"A Pulumi package for creating and managing InfluxDB V3 resources.","keywords":["pulumi","influxdb3","category/database"],"homepage":"https://www.influxdata.com","license":"Apache-2.0","attribution":"This Pulumi package is based on the [`influxdb3` Terraform Provider](https://github.com/komminarlabs/terraform-provider-influxdb3).","repository":"https://github.com/komminarlabs/pulumi-influxdb3","logoUrl":"https://avatars.githubusercontent.com/u/5713248?s=200\u0026v=4","pluginDownloadURL":"github://api.github.com/komminarlabs","publisher":"komminarlabs","meta":{"moduleFormat":"(.*)(?:/[^/]*)"},"language":{"csharp":{"packageReferences":{"Pulumi":"3.*"},"namespaces":{"influxdb3":"InfluxDB3"},"compatibility":"tfbridge20","rootNamespace":"KomminarLabs"},"go":{"importBasePath":"github.com/komminarlabs/pulumi-influxdb3/sdk/go/influxdb3","generateResourceContainerTypes":true,"generateExtraInputTypes":true},"nodejs":{"packageName":"@komminarlabs/influxdb3","packageDescription":"A Pulumi package for creating and managing InfluxDB V3 resources.","readme":"\u003e This provider is a derived work of the [Terraform Provider](https://github.com/komminarlabs/terraform-provider-influxdb3)\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-influxdb3` repo](https://github.com/komminarlabs/pulumi-influxdb3/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-influxdb3` repo](https://github.com/komminarlabs/terraform-provider-influxdb3/issues).","dependencies":{"@pulumi/pulumi":"^3.0.0"},"devDependencies":{"@types/mime":"^2.0.0","@types/node":"^10.0.0"},"compatibility":"tfbridge20","disableUnionOutputTypes":true},"python":{"packageName":"komminarlabs_influxdb3","requires":{"pulumi":"\u003e=3.0.0,\u003c4.0.0"},"readme":"\u003e This provider is a derived work of the [Terraform Provider](https://github.com/komminarlabs/terraform-provider-influxdb3)\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-influxdb3` repo](https://github.com/komminarlabs/pulumi-influxdb3/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-influxdb3` repo](https://github.com/komminarlabs/terraform-provider-influxdb3/issues).","compatibility":"tfbridge20","pyproject":{}}},"config":{"variables":{"accountId":{"type":"string","description":"The ID of the account that the cluster belongs to\n","secret":true},"clusterId":{"type":"string","description":"The ID of the cluster that you want to manage\n","secret":true},"token":{"type":"string","description":"The InfluxDB management token\n","secret":true},"url":{"type":"string","description":"The InfluxDB Cloud Dedicated Management API URL\n"}}},"types":{"influxdb3:index/DatabasePartitionTemplate:DatabasePartitionTemplate":{"properties":{"type":{"type":"string","description":"The type of template part. Valid values are `bucket`, `tag` or `time`.\n"},"value":{"type":"string","description":"The value of template part. **Note:** For `bucket` partition template type use `jsonencode()` function to encode the value to a string.\n"}},"type":"object","required":["type","value"]},"influxdb3:index/TokenPermission:TokenPermission":{"properties":{"action":{"type":"string","description":"The action the database token permission allows. Valid values are `read` or `write`.\n"},"resource":{"type":"string","description":"The resource the database token permission applies to. `*` refers to all databases.\n"}},"type":"object","required":["action","resource"]},"influxdb3:index/getDatabasePartitionTemplate:getDatabasePartitionTemplate":{"properties":{"type":{"type":"string","description":"The type of template part.\n"},"value":{"type":"string","description":"The value of template part.\n"}},"type":"object","required":["type","value"],"language":{"nodejs":{"requiredInputs":[]}}},"influxdb3:index/getDatabasesDatabase:getDatabasesDatabase":{"properties":{"accountId":{"type":"string","description":"The ID of the account that the cluster belongs to.\n"},"clusterId":{"type":"string","description":"The ID of the cluster that you want to manage.\n"},"maxColumnsPerTable":{"type":"integer","description":"The maximum number of columns per table for the cluster database.\n"},"maxTables":{"type":"integer","description":"The maximum number of tables for the cluster database.\n"},"name":{"type":"string","description":"The name of the cluster database.\n"},"partitionTemplates":{"type":"array","items":{"$ref":"#/types/influxdb3:index/getDatabasesDatabasePartitionTemplate:getDatabasesDatabasePartitionTemplate"},"description":"The template partitioning of the cluster database.\n"},"retentionPeriod":{"type":"integer","description":"The retention period of the cluster database in nanoseconds.\n"}},"type":"object","required":["accountId","clusterId","maxColumnsPerTable","maxTables","name","partitionTemplates","retentionPeriod"],"language":{"nodejs":{"requiredInputs":[]}}},"influxdb3:index/getDatabasesDatabasePartitionTemplate:getDatabasesDatabasePartitionTemplate":{"properties":{"type":{"type":"string","description":"The type of template part.\n"},"value":{"type":"string","description":"The value of template part.\n"}},"type":"object","required":["type","value"],"language":{"nodejs":{"requiredInputs":[]}}},"influxdb3:index/getTokenPermission:getTokenPermission":{"properties":{"action":{"type":"string","description":"The action the database token permission allows.\n"},"resource":{"type":"string","description":"The resource the database token permission applies to. `*` refers to all databases.\n"}},"type":"object","required":["action","resource"],"language":{"nodejs":{"requiredInputs":[]}}},"influxdb3:index/getTokensToken:getTokensToken":{"properties":{"accessToken":{"type":"string","description":"The access token that can be used to authenticate query and write requests to the cluster. The access token is never stored by InfluxDB and is only returned once when the token is created. If the access token is lost, a new token must be created.\n","secret":true},"accountId":{"type":"string","description":"The ID of the account that the database token belongs to.\n"},"clusterId":{"type":"string","description":"The ID of the cluster that the database token belongs to.\n"},"createdAt":{"type":"string","description":"The date and time that the database token was created. Uses RFC3339 format.\n"},"description":{"type":"string","description":"The description of the database token.\n"},"id":{"type":"string","description":"The ID of the database token.\n"},"permissions":{"type":"array","items":{"$ref":"#/types/influxdb3:index/getTokensTokenPermission:getTokensTokenPermission"},"description":"The list of permissions the database token allows.\n"}},"type":"object","required":["accessToken","accountId","clusterId","createdAt","description","id","permissions"],"language":{"nodejs":{"requiredInputs":[]}}},"influxdb3:index/getTokensTokenPermission:getTokensTokenPermission":{"properties":{"action":{"type":"string","description":"The action the database token permission allows.\n"},"resource":{"type":"string","description":"The resource the database token permission applies to. `*` refers to all databases.\n"}},"type":"object","required":["action","resource"],"language":{"nodejs":{"requiredInputs":[]}}}},"provider":{"description":"The provider type for the influxdb3 package. By default, resources use package-wide configuration\nsettings, however an explicit `Provider` instance may be created and passed during resource\nconstruction to achieve fine-grained programmatic control over provider settings. See the\n[documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.\n","properties":{"accountId":{"type":"string","description":"The ID of the account that the cluster belongs to\n","secret":true},"clusterId":{"type":"string","description":"The ID of the cluster that you want to manage\n","secret":true},"token":{"type":"string","description":"The InfluxDB management token\n","secret":true},"url":{"type":"string","description":"The InfluxDB Cloud Dedicated Management API URL\n"}},"inputProperties":{"accountId":{"type":"string","description":"The ID of the account that the cluster belongs to\n","secret":true},"clusterId":{"type":"string","description":"The ID of the cluster that you want to manage\n","secret":true},"token":{"type":"string","description":"The InfluxDB management token\n","secret":true},"url":{"type":"string","description":"The InfluxDB Cloud Dedicated Management API URL\n"}}},"resources":{"influxdb3:index/database:Database":{"description":"Creates and manages a database.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as influxdb3 from \"@komminarlabs/influxdb3\";\n\nconst signals = new influxdb3.Database(\"signals\", {\n retentionPeriod: 604800,\n partitionTemplates: [\n {\n type: \"tag\",\n value: \"line\",\n },\n {\n type: \"tag\",\n value: \"station\",\n },\n {\n type: \"time\",\n value: \"%Y-%m-%d\",\n },\n {\n type: \"bucket\",\n value: JSON.stringify({\n tagName: \"temperature\",\n numberOfBuckets: 10,\n }),\n },\n ],\n});\n```\n```python\nimport pulumi\nimport json\nimport komminarlabs_influxdb3 as influxdb3\n\nsignals = influxdb3.Database(\"signals\",\n retention_period=604800,\n partition_templates=[\n influxdb3.DatabasePartitionTemplateArgs(\n type=\"tag\",\n value=\"line\",\n ),\n influxdb3.DatabasePartitionTemplateArgs(\n type=\"tag\",\n value=\"station\",\n ),\n influxdb3.DatabasePartitionTemplateArgs(\n type=\"time\",\n value=\"%Y-%m-%d\",\n ),\n influxdb3.DatabasePartitionTemplateArgs(\n type=\"bucket\",\n value=json.dumps({\n \"tagName\": \"temperature\",\n \"numberOfBuckets\": 10,\n }),\n ),\n ])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text.Json;\nusing Pulumi;\nusing InfluxDB3 = KomminarLabs.InfluxDB3;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var signals = new InfluxDB3.Database(\"signals\", new()\n {\n RetentionPeriod = 604800,\n PartitionTemplates = new[]\n {\n new InfluxDB3.Inputs.DatabasePartitionTemplateArgs\n {\n Type = \"tag\",\n Value = \"line\",\n },\n new InfluxDB3.Inputs.DatabasePartitionTemplateArgs\n {\n Type = \"tag\",\n Value = \"station\",\n },\n new InfluxDB3.Inputs.DatabasePartitionTemplateArgs\n {\n Type = \"time\",\n Value = \"%Y-%m-%d\",\n },\n new InfluxDB3.Inputs.DatabasePartitionTemplateArgs\n {\n Type = \"bucket\",\n Value = JsonSerializer.Serialize(new Dictionary\u003cstring, object?\u003e\n {\n [\"tagName\"] = \"temperature\",\n [\"numberOfBuckets\"] = 10,\n }),\n },\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\n\t\"github.com/komminarlabs/pulumi-influxdb3/sdk/go/influxdb3\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\ttmpJSON0, err := json.Marshal(map[string]interface{}{\n\t\t\t\"tagName\": \"temperature\",\n\t\t\t\"numberOfBuckets\": 10,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tjson0 := string(tmpJSON0)\n\t\t_, err = influxdb3.NewDatabase(ctx, \"signals\", \u0026influxdb3.DatabaseArgs{\n\t\t\tRetentionPeriod: pulumi.Int(604800),\n\t\t\tPartitionTemplates: influxdb3.DatabasePartitionTemplateArray{\n\t\t\t\t\u0026influxdb3.DatabasePartitionTemplateArgs{\n\t\t\t\t\tType: pulumi.String(\"tag\"),\n\t\t\t\t\tValue: pulumi.String(\"line\"),\n\t\t\t\t},\n\t\t\t\t\u0026influxdb3.DatabasePartitionTemplateArgs{\n\t\t\t\t\tType: pulumi.String(\"tag\"),\n\t\t\t\t\tValue: pulumi.String(\"station\"),\n\t\t\t\t},\n\t\t\t\t\u0026influxdb3.DatabasePartitionTemplateArgs{\n\t\t\t\t\tType: pulumi.String(\"time\"),\n\t\t\t\t\tValue: pulumi.String(\"%Y-%m-%d\"),\n\t\t\t\t},\n\t\t\t\t\u0026influxdb3.DatabasePartitionTemplateArgs{\n\t\t\t\t\tType: pulumi.String(\"bucket\"),\n\t\t\t\t\tValue: pulumi.String(json0),\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.influxdb3.Database;\nimport com.pulumi.influxdb3.DatabaseArgs;\nimport com.pulumi.influxdb3.inputs.DatabasePartitionTemplateArgs;\nimport static com.pulumi.codegen.internal.Serialization.*;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var signals = new Database(\"signals\", DatabaseArgs.builder() \n .retentionPeriod(604800)\n .partitionTemplates( \n DatabasePartitionTemplateArgs.builder()\n .type(\"tag\")\n .value(\"line\")\n .build(),\n DatabasePartitionTemplateArgs.builder()\n .type(\"tag\")\n .value(\"station\")\n .build(),\n DatabasePartitionTemplateArgs.builder()\n .type(\"time\")\n .value(\"%Y-%m-%d\")\n .build(),\n DatabasePartitionTemplateArgs.builder()\n .type(\"bucket\")\n .value(serializeJson(\n jsonObject(\n jsonProperty(\"tagName\", \"temperature\"),\n jsonProperty(\"numberOfBuckets\", 10)\n )))\n .build())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n signals:\n type: influxdb3:Database\n properties:\n retentionPeriod: 604800\n partitionTemplates:\n - type: tag\n value: line\n - type: tag\n value: station\n - type: time\n value: '%Y-%m-%d'\n - type: bucket\n value:\n fn::toJSON:\n tagName: temperature\n numberOfBuckets: 10\n```\n{{% /example %}}\n{{% /examples %}}","properties":{"accountId":{"type":"string","description":"The ID of the account that the cluster belongs to.\n"},"clusterId":{"type":"string","description":"The ID of the cluster that you want to manage.\n"},"maxColumnsPerTable":{"type":"integer","description":"The maximum number of columns per table for the cluster database. The default is `200`\n"},"maxTables":{"type":"integer","description":"The maximum number of tables for the cluster database. The default is `500`\n"},"name":{"type":"string","description":"The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database.\n"},"partitionTemplates":{"type":"array","items":{"$ref":"#/types/influxdb3:index/DatabasePartitionTemplate:DatabasePartitionTemplate"},"description":"A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement.\n"},"retentionPeriod":{"type":"integer","description":"The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention.\n"}},"required":["accountId","clusterId","maxColumnsPerTable","maxTables","name","partitionTemplates","retentionPeriod"],"inputProperties":{"maxColumnsPerTable":{"type":"integer","description":"The maximum number of columns per table for the cluster database. The default is `200`\n"},"maxTables":{"type":"integer","description":"The maximum number of tables for the cluster database. The default is `500`\n"},"name":{"type":"string","description":"The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database.\n"},"partitionTemplates":{"type":"array","items":{"$ref":"#/types/influxdb3:index/DatabasePartitionTemplate:DatabasePartitionTemplate"},"description":"A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement.\n"},"retentionPeriod":{"type":"integer","description":"The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention.\n"}},"stateInputs":{"description":"Input properties used for looking up and filtering Database resources.\n","properties":{"accountId":{"type":"string","description":"The ID of the account that the cluster belongs to.\n"},"clusterId":{"type":"string","description":"The ID of the cluster that you want to manage.\n"},"maxColumnsPerTable":{"type":"integer","description":"The maximum number of columns per table for the cluster database. The default is `200`\n"},"maxTables":{"type":"integer","description":"The maximum number of tables for the cluster database. The default is `500`\n"},"name":{"type":"string","description":"The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database.\n"},"partitionTemplates":{"type":"array","items":{"$ref":"#/types/influxdb3:index/DatabasePartitionTemplate:DatabasePartitionTemplate"},"description":"A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement.\n"},"retentionPeriod":{"type":"integer","description":"The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention.\n"}},"type":"object"}},"influxdb3:index/token:Token":{"description":"Creates and manages a token and returns the generated database token. Use this resource to create/manage a token, which generates an database token with permissions to read or write to a specific database.\n","properties":{"accessToken":{"type":"string","description":"The access token that can be used to authenticate query and write requests to the cluster. The access token is never stored by InfluxDB and is only returned once when the token is created. If the access token is lost, a new token must be created.\n","secret":true},"accountId":{"type":"string","description":"The ID of the account that the database token belongs to.\n"},"clusterId":{"type":"string","description":"The ID of the cluster that the database token belongs to.\n"},"createdAt":{"type":"string","description":"The date and time that the database token was created. Uses RFC3339 format.\n"},"description":{"type":"string","description":"The description of the database token.\n"},"permissions":{"type":"array","items":{"$ref":"#/types/influxdb3:index/TokenPermission:TokenPermission"},"description":"The list of permissions the database token allows.\n"}},"required":["accessToken","accountId","clusterId","createdAt","description","permissions"],"inputProperties":{"description":{"type":"string","description":"The description of the database token.\n"},"permissions":{"type":"array","items":{"$ref":"#/types/influxdb3:index/TokenPermission:TokenPermission"},"description":"The list of permissions the database token allows.\n"}},"requiredInputs":["description","permissions"],"stateInputs":{"description":"Input properties used for looking up and filtering Token resources.\n","properties":{"accessToken":{"type":"string","description":"The access token that can be used to authenticate query and write requests to the cluster. The access token is never stored by InfluxDB and is only returned once when the token is created. If the access token is lost, a new token must be created.\n","secret":true},"accountId":{"type":"string","description":"The ID of the account that the database token belongs to.\n"},"clusterId":{"type":"string","description":"The ID of the cluster that the database token belongs to.\n"},"createdAt":{"type":"string","description":"The date and time that the database token was created. Uses RFC3339 format.\n"},"description":{"type":"string","description":"The description of the database token.\n"},"permissions":{"type":"array","items":{"$ref":"#/types/influxdb3:index/TokenPermission:TokenPermission"},"description":"The list of permissions the database token allows.\n"}},"type":"object"}}},"functions":{"influxdb3:index/getDatabase:getDatabase":{"description":"Retrieves a database. Use this data source to retrieve information for a specific database.\n","inputs":{"description":"A collection of arguments for invoking getDatabase.\n","properties":{"name":{"type":"string","description":"The name of the cluster database.\n"}},"type":"object","required":["name"]},"outputs":{"description":"A collection of values returned by getDatabase.\n","properties":{"accountId":{"description":"The ID of the account that the cluster belongs to.\n","type":"string"},"clusterId":{"description":"The ID of the cluster that you want to manage.\n","type":"string"},"id":{"description":"The provider-assigned unique ID for this managed resource.\n","type":"string"},"maxColumnsPerTable":{"description":"The maximum number of columns per table for the cluster database.\n","type":"integer"},"maxTables":{"description":"The maximum number of tables for the cluster database.\n","type":"integer"},"name":{"description":"The name of the cluster database.\n","type":"string"},"partitionTemplates":{"description":"The template partitioning of the cluster database.\n","items":{"$ref":"#/types/influxdb3:index/getDatabasePartitionTemplate:getDatabasePartitionTemplate"},"type":"array"},"retentionPeriod":{"description":"The retention period of the cluster database in nanoseconds.\n","type":"integer"}},"required":["accountId","clusterId","maxColumnsPerTable","maxTables","name","partitionTemplates","retentionPeriod","id"],"type":"object"}},"influxdb3:index/getDatabases:getDatabases":{"description":"Gets all databases for a cluster.\n","outputs":{"description":"A collection of values returned by getDatabases.\n","properties":{"databases":{"items":{"$ref":"#/types/influxdb3:index/getDatabasesDatabase:getDatabasesDatabase"},"type":"array"},"id":{"description":"The provider-assigned unique ID for this managed resource.\n","type":"string"}},"required":["databases","id"],"type":"object"}},"influxdb3:index/getToken:getToken":{"description":"Gets a database token. Use this data source to retrieve information about a database token, including the token's permissions.\n","inputs":{"description":"A collection of arguments for invoking getToken.\n","properties":{"id":{"type":"string","description":"The ID of the database token.\n"}},"type":"object","required":["id"]},"outputs":{"description":"A collection of values returned by getToken.\n","properties":{"accessToken":{"description":"The access token that can be used to authenticate query and write requests to the cluster. The access token is never stored by InfluxDB and is only returned once when the token is created. If the access token is lost, a new token must be created.\n","secret":true,"type":"string"},"accountId":{"description":"The ID of the account that the database token belongs to.\n","type":"string"},"clusterId":{"description":"The ID of the cluster that the database token belongs to.\n","type":"string"},"createdAt":{"description":"The date and time that the database token was created. Uses RFC3339 format.\n","type":"string"},"description":{"description":"The description of the database token.\n","type":"string"},"id":{"description":"The ID of the database token.\n","type":"string"},"permissions":{"description":"The list of permissions the database token allows.\n","items":{"$ref":"#/types/influxdb3:index/getTokenPermission:getTokenPermission"},"type":"array"}},"required":["accessToken","accountId","clusterId","createdAt","description","id","permissions"],"type":"object"}},"influxdb3:index/getTokens:getTokens":{"description":"Gets all database tokens for a cluster.\n","outputs":{"description":"A collection of values returned by getTokens.\n","properties":{"id":{"description":"The provider-assigned unique ID for this managed resource.\n","type":"string"},"tokens":{"items":{"$ref":"#/types/influxdb3:index/getTokensToken:getTokensToken"},"type":"array"}},"required":["tokens","id"],"type":"object"}}}} \ No newline at end of file diff --git a/provider/cmd/pulumi-resource-influxdb3/schema.json b/provider/cmd/pulumi-resource-influxdb3/schema.json index e30f9a9..c11c479 100644 --- a/provider/cmd/pulumi-resource-influxdb3/schema.json +++ b/provider/cmd/pulumi-resource-influxdb3/schema.json @@ -81,6 +81,23 @@ } }, "types": { + "influxdb3:index/DatabasePartitionTemplate:DatabasePartitionTemplate": { + "properties": { + "type": { + "type": "string", + "description": "The type of template part. Valid values are `bucket`, `tag` or `time`.\n" + }, + "value": { + "type": "string", + "description": "The value of template part. **Note:** For `bucket` partition template type use `jsonencode()` function to encode the value to a string.\n" + } + }, + "type": "object", + "required": [ + "type", + "value" + ] + }, "influxdb3:index/TokenPermission:TokenPermission": { "properties": { "action": { @@ -98,6 +115,28 @@ "resource" ] }, + "influxdb3:index/getDatabasePartitionTemplate:getDatabasePartitionTemplate": { + "properties": { + "type": { + "type": "string", + "description": "The type of template part.\n" + }, + "value": { + "type": "string", + "description": "The value of template part.\n" + } + }, + "type": "object", + "required": [ + "type", + "value" + ], + "language": { + "nodejs": { + "requiredInputs": [] + } + } + }, "influxdb3:index/getDatabasesDatabase:getDatabasesDatabase": { "properties": { "accountId": { @@ -120,6 +159,13 @@ "type": "string", "description": "The name of the cluster database.\n" }, + "partitionTemplates": { + "type": "array", + "items": { + "$ref": "#/types/influxdb3:index/getDatabasesDatabasePartitionTemplate:getDatabasesDatabasePartitionTemplate" + }, + "description": "The template partitioning of the cluster database.\n" + }, "retentionPeriod": { "type": "integer", "description": "The retention period of the cluster database in nanoseconds.\n" @@ -132,6 +178,7 @@ "maxColumnsPerTable", "maxTables", "name", + "partitionTemplates", "retentionPeriod" ], "language": { @@ -140,6 +187,28 @@ } } }, + "influxdb3:index/getDatabasesDatabasePartitionTemplate:getDatabasesDatabasePartitionTemplate": { + "properties": { + "type": { + "type": "string", + "description": "The type of template part.\n" + }, + "value": { + "type": "string", + "description": "The value of template part.\n" + } + }, + "type": "object", + "required": [ + "type", + "value" + ], + "language": { + "nodejs": { + "requiredInputs": [] + } + } + }, "influxdb3:index/getTokenPermission:getTokenPermission": { "properties": { "action": { @@ -283,7 +352,7 @@ }, "resources": { "influxdb3:index/database:Database": { - "description": "Creates and manages a database.\n", + "description": "Creates and manages a database.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as influxdb3 from \"@komminarlabs/influxdb3\";\n\nconst signals = new influxdb3.Database(\"signals\", {\n retentionPeriod: 604800,\n partitionTemplates: [\n {\n type: \"tag\",\n value: \"line\",\n },\n {\n type: \"tag\",\n value: \"station\",\n },\n {\n type: \"time\",\n value: \"%Y-%m-%d\",\n },\n {\n type: \"bucket\",\n value: JSON.stringify({\n tagName: \"temperature\",\n numberOfBuckets: 10,\n }),\n },\n ],\n});\n```\n```python\nimport pulumi\nimport json\nimport komminarlabs_influxdb3 as influxdb3\n\nsignals = influxdb3.Database(\"signals\",\n retention_period=604800,\n partition_templates=[\n influxdb3.DatabasePartitionTemplateArgs(\n type=\"tag\",\n value=\"line\",\n ),\n influxdb3.DatabasePartitionTemplateArgs(\n type=\"tag\",\n value=\"station\",\n ),\n influxdb3.DatabasePartitionTemplateArgs(\n type=\"time\",\n value=\"%Y-%m-%d\",\n ),\n influxdb3.DatabasePartitionTemplateArgs(\n type=\"bucket\",\n value=json.dumps({\n \"tagName\": \"temperature\",\n \"numberOfBuckets\": 10,\n }),\n ),\n ])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text.Json;\nusing Pulumi;\nusing InfluxDB3 = KomminarLabs.InfluxDB3;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var signals = new InfluxDB3.Database(\"signals\", new()\n {\n RetentionPeriod = 604800,\n PartitionTemplates = new[]\n {\n new InfluxDB3.Inputs.DatabasePartitionTemplateArgs\n {\n Type = \"tag\",\n Value = \"line\",\n },\n new InfluxDB3.Inputs.DatabasePartitionTemplateArgs\n {\n Type = \"tag\",\n Value = \"station\",\n },\n new InfluxDB3.Inputs.DatabasePartitionTemplateArgs\n {\n Type = \"time\",\n Value = \"%Y-%m-%d\",\n },\n new InfluxDB3.Inputs.DatabasePartitionTemplateArgs\n {\n Type = \"bucket\",\n Value = JsonSerializer.Serialize(new Dictionary\u003cstring, object?\u003e\n {\n [\"tagName\"] = \"temperature\",\n [\"numberOfBuckets\"] = 10,\n }),\n },\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\n\t\"github.com/komminarlabs/pulumi-influxdb3/sdk/go/influxdb3\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\ttmpJSON0, err := json.Marshal(map[string]interface{}{\n\t\t\t\"tagName\": \"temperature\",\n\t\t\t\"numberOfBuckets\": 10,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tjson0 := string(tmpJSON0)\n\t\t_, err = influxdb3.NewDatabase(ctx, \"signals\", \u0026influxdb3.DatabaseArgs{\n\t\t\tRetentionPeriod: pulumi.Int(604800),\n\t\t\tPartitionTemplates: influxdb3.DatabasePartitionTemplateArray{\n\t\t\t\t\u0026influxdb3.DatabasePartitionTemplateArgs{\n\t\t\t\t\tType: pulumi.String(\"tag\"),\n\t\t\t\t\tValue: pulumi.String(\"line\"),\n\t\t\t\t},\n\t\t\t\t\u0026influxdb3.DatabasePartitionTemplateArgs{\n\t\t\t\t\tType: pulumi.String(\"tag\"),\n\t\t\t\t\tValue: pulumi.String(\"station\"),\n\t\t\t\t},\n\t\t\t\t\u0026influxdb3.DatabasePartitionTemplateArgs{\n\t\t\t\t\tType: pulumi.String(\"time\"),\n\t\t\t\t\tValue: pulumi.String(\"%Y-%m-%d\"),\n\t\t\t\t},\n\t\t\t\t\u0026influxdb3.DatabasePartitionTemplateArgs{\n\t\t\t\t\tType: pulumi.String(\"bucket\"),\n\t\t\t\t\tValue: pulumi.String(json0),\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.influxdb3.Database;\nimport com.pulumi.influxdb3.DatabaseArgs;\nimport com.pulumi.influxdb3.inputs.DatabasePartitionTemplateArgs;\nimport static com.pulumi.codegen.internal.Serialization.*;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var signals = new Database(\"signals\", DatabaseArgs.builder() \n .retentionPeriod(604800)\n .partitionTemplates( \n DatabasePartitionTemplateArgs.builder()\n .type(\"tag\")\n .value(\"line\")\n .build(),\n DatabasePartitionTemplateArgs.builder()\n .type(\"tag\")\n .value(\"station\")\n .build(),\n DatabasePartitionTemplateArgs.builder()\n .type(\"time\")\n .value(\"%Y-%m-%d\")\n .build(),\n DatabasePartitionTemplateArgs.builder()\n .type(\"bucket\")\n .value(serializeJson(\n jsonObject(\n jsonProperty(\"tagName\", \"temperature\"),\n jsonProperty(\"numberOfBuckets\", 10)\n )))\n .build())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n signals:\n type: influxdb3:Database\n properties:\n retentionPeriod: 604800\n partitionTemplates:\n - type: tag\n value: line\n - type: tag\n value: station\n - type: time\n value: '%Y-%m-%d'\n - type: bucket\n value:\n fn::toJSON:\n tagName: temperature\n numberOfBuckets: 10\n```\n{{% /example %}}\n{{% /examples %}}", "properties": { "accountId": { "type": "string", @@ -303,7 +372,14 @@ }, "name": { "type": "string", - "description": "The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database.\n" + "description": "The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database.\n" + }, + "partitionTemplates": { + "type": "array", + "items": { + "$ref": "#/types/influxdb3:index/DatabasePartitionTemplate:DatabasePartitionTemplate" + }, + "description": "A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement.\n" }, "retentionPeriod": { "type": "integer", @@ -316,6 +392,7 @@ "maxColumnsPerTable", "maxTables", "name", + "partitionTemplates", "retentionPeriod" ], "inputProperties": { @@ -329,7 +406,14 @@ }, "name": { "type": "string", - "description": "The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database.\n" + "description": "The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database.\n" + }, + "partitionTemplates": { + "type": "array", + "items": { + "$ref": "#/types/influxdb3:index/DatabasePartitionTemplate:DatabasePartitionTemplate" + }, + "description": "A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement.\n" }, "retentionPeriod": { "type": "integer", @@ -357,7 +441,14 @@ }, "name": { "type": "string", - "description": "The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database.\n" + "description": "The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database.\n" + }, + "partitionTemplates": { + "type": "array", + "items": { + "$ref": "#/types/influxdb3:index/DatabasePartitionTemplate:DatabasePartitionTemplate" + }, + "description": "A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement.\n" }, "retentionPeriod": { "type": "integer", @@ -503,6 +594,13 @@ "type": "string", "description": "The name of the cluster database.\n" }, + "partitionTemplates": { + "type": "array", + "items": { + "$ref": "#/types/influxdb3:index/getDatabasePartitionTemplate:getDatabasePartitionTemplate" + }, + "description": "The template partitioning of the cluster database.\n" + }, "retentionPeriod": { "type": "integer", "description": "The retention period of the cluster database in nanoseconds.\n" @@ -515,6 +613,7 @@ "maxColumnsPerTable", "maxTables", "name", + "partitionTemplates", "retentionPeriod", "id" ] diff --git a/provider/go.mod b/provider/go.mod index 65e29b2..b625896 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -145,7 +145,7 @@ require ( github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/klauspost/compress v1.16.7 // indirect github.com/komminarlabs/influxdb3 v0.1.0 // indirect - github.com/komminarlabs/terraform-provider-influxdb3 v1.0.1 // indirect + github.com/komminarlabs/terraform-provider-influxdb3 v1.2.1 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect diff --git a/provider/go.sum b/provider/go.sum index eb49887..78d495b 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -1357,8 +1357,8 @@ github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQs github.com/kolo/xmlrpc v0.0.0-20201022064351-38db28db192b/go.mod h1:pcaDhQK0/NJZEvtCO0qQPPropqV0sJOJ6YW7X+9kRwM= github.com/komminarlabs/influxdb3 v0.1.0 h1:C/Ka8mzYABMXZIAjvZYw+ZXlk0jo6u9shJ7vPgKoseo= github.com/komminarlabs/influxdb3 v0.1.0/go.mod h1:yEFMuSRwwd1/nO9tKtc1HapjEm5h1Ac/3+or3ckkURE= -github.com/komminarlabs/terraform-provider-influxdb3 v1.0.1 h1:ZVPHZvFPuclTBp+86JvcElc4L0gGYA0+GK4ZWE5zxgA= -github.com/komminarlabs/terraform-provider-influxdb3 v1.0.1/go.mod h1:w8P/TgdYA5dtoba+5ELEzXEzz8gEiqmcfPFJ3gtEUuU= +github.com/komminarlabs/terraform-provider-influxdb3 v1.2.1 h1:DHRUMPfoqis7GcsJTiK8xc68WE/UxKmHzkHrZ4w5Rvs= +github.com/komminarlabs/terraform-provider-influxdb3 v1.2.1/go.mod h1:w8P/TgdYA5dtoba+5ELEzXEzz8gEiqmcfPFJ3gtEUuU= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= diff --git a/provider/shim/go.mod b/provider/shim/go.mod index e8857d4..84dcb49 100644 --- a/provider/shim/go.mod +++ b/provider/shim/go.mod @@ -4,7 +4,7 @@ go 1.22.2 require ( github.com/hashicorp/terraform-plugin-framework v1.11.0 - github.com/komminarlabs/terraform-provider-influxdb3 v1.0.1 + github.com/komminarlabs/terraform-provider-influxdb3 v1.2.1 ) require ( diff --git a/provider/shim/go.sum b/provider/shim/go.sum index 718ac93..3ae1b00 100644 --- a/provider/shim/go.sum +++ b/provider/shim/go.sum @@ -73,8 +73,8 @@ github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbg github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/komminarlabs/influxdb3 v0.1.0 h1:C/Ka8mzYABMXZIAjvZYw+ZXlk0jo6u9shJ7vPgKoseo= github.com/komminarlabs/influxdb3 v0.1.0/go.mod h1:yEFMuSRwwd1/nO9tKtc1HapjEm5h1Ac/3+or3ckkURE= -github.com/komminarlabs/terraform-provider-influxdb3 v1.0.1 h1:ZVPHZvFPuclTBp+86JvcElc4L0gGYA0+GK4ZWE5zxgA= -github.com/komminarlabs/terraform-provider-influxdb3 v1.0.1/go.mod h1:w8P/TgdYA5dtoba+5ELEzXEzz8gEiqmcfPFJ3gtEUuU= +github.com/komminarlabs/terraform-provider-influxdb3 v1.2.1 h1:DHRUMPfoqis7GcsJTiK8xc68WE/UxKmHzkHrZ4w5Rvs= +github.com/komminarlabs/terraform-provider-influxdb3 v1.2.1/go.mod h1:w8P/TgdYA5dtoba+5ELEzXEzz8gEiqmcfPFJ3gtEUuU= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= diff --git a/sdk/dotnet/Database.cs b/sdk/dotnet/Database.cs index 8106a8d..11bc7c2 100644 --- a/sdk/dotnet/Database.cs +++ b/sdk/dotnet/Database.cs @@ -12,6 +12,52 @@ namespace KomminarLabs.InfluxDB3 { /// /// Creates and manages a database. + /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using System.Text.Json; + /// using Pulumi; + /// using InfluxDB3 = KomminarLabs.InfluxDB3; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var signals = new InfluxDB3.Database("signals", new() + /// { + /// RetentionPeriod = 604800, + /// PartitionTemplates = new[] + /// { + /// new InfluxDB3.Inputs.DatabasePartitionTemplateArgs + /// { + /// Type = "tag", + /// Value = "line", + /// }, + /// new InfluxDB3.Inputs.DatabasePartitionTemplateArgs + /// { + /// Type = "tag", + /// Value = "station", + /// }, + /// new InfluxDB3.Inputs.DatabasePartitionTemplateArgs + /// { + /// Type = "time", + /// Value = "%Y-%m-%d", + /// }, + /// new InfluxDB3.Inputs.DatabasePartitionTemplateArgs + /// { + /// Type = "bucket", + /// Value = JsonSerializer.Serialize(new Dictionary<string, object?> + /// { + /// ["tagName"] = "temperature", + /// ["numberOfBuckets"] = 10, + /// }), + /// }, + /// }, + /// }); + /// + /// }); + /// ``` /// [InfluxDB3ResourceType("influxdb3:index/database:Database")] public partial class Database : global::Pulumi.CustomResource @@ -41,11 +87,17 @@ public partial class Database : global::Pulumi.CustomResource public Output MaxTables { get; private set; } = null!; /// - /// The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + /// The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. /// [Output("name")] public Output Name { get; private set; } = null!; + /// + /// A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement. + /// + [Output("partitionTemplates")] + public Output> PartitionTemplates { get; private set; } = null!; + /// /// The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention. /// @@ -112,11 +164,23 @@ public sealed class DatabaseArgs : global::Pulumi.ResourceArgs public Input? MaxTables { get; set; } /// - /// The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + /// The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. /// [Input("name")] public Input? Name { get; set; } + [Input("partitionTemplates")] + private InputList? _partitionTemplates; + + /// + /// A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement. + /// + public InputList PartitionTemplates + { + get => _partitionTemplates ?? (_partitionTemplates = new InputList()); + set => _partitionTemplates = value; + } + /// /// The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention. /// @@ -156,11 +220,23 @@ public sealed class DatabaseState : global::Pulumi.ResourceArgs public Input? MaxTables { get; set; } /// - /// The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + /// The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. /// [Input("name")] public Input? Name { get; set; } + [Input("partitionTemplates")] + private InputList? _partitionTemplates; + + /// + /// A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement. + /// + public InputList PartitionTemplates + { + get => _partitionTemplates ?? (_partitionTemplates = new InputList()); + set => _partitionTemplates = value; + } + /// /// The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention. /// diff --git a/sdk/dotnet/GetDatabase.cs b/sdk/dotnet/GetDatabase.cs index 2f5e678..ab4a2c2 100644 --- a/sdk/dotnet/GetDatabase.cs +++ b/sdk/dotnet/GetDatabase.cs @@ -83,6 +83,10 @@ public sealed class GetDatabaseResult /// public readonly string Name; /// + /// The template partitioning of the cluster database. + /// + public readonly ImmutableArray PartitionTemplates; + /// /// The retention period of the cluster database in nanoseconds. /// public readonly int RetentionPeriod; @@ -101,6 +105,8 @@ private GetDatabaseResult( string name, + ImmutableArray partitionTemplates, + int retentionPeriod) { AccountId = accountId; @@ -109,6 +115,7 @@ private GetDatabaseResult( MaxColumnsPerTable = maxColumnsPerTable; MaxTables = maxTables; Name = name; + PartitionTemplates = partitionTemplates; RetentionPeriod = retentionPeriod; } } diff --git a/sdk/dotnet/Inputs/DatabasePartitionTemplateArgs.cs b/sdk/dotnet/Inputs/DatabasePartitionTemplateArgs.cs new file mode 100644 index 0000000..0bbd53d --- /dev/null +++ b/sdk/dotnet/Inputs/DatabasePartitionTemplateArgs.cs @@ -0,0 +1,33 @@ +// *** 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! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; +using Pulumi; + +namespace KomminarLabs.InfluxDB3.Inputs +{ + + public sealed class DatabasePartitionTemplateArgs : global::Pulumi.ResourceArgs + { + /// + /// The type of template part. Valid values are `bucket`, `tag` or `time`. + /// + [Input("type", required: true)] + public Input Type { get; set; } = null!; + + /// + /// The value of template part. **Note:** For `bucket` partition template type use `jsonencode()` function to encode the value to a string. + /// + [Input("value", required: true)] + public Input Value { get; set; } = null!; + + public DatabasePartitionTemplateArgs() + { + } + public static new DatabasePartitionTemplateArgs Empty => new DatabasePartitionTemplateArgs(); + } +} diff --git a/sdk/dotnet/Inputs/DatabasePartitionTemplateGetArgs.cs b/sdk/dotnet/Inputs/DatabasePartitionTemplateGetArgs.cs new file mode 100644 index 0000000..75a1d55 --- /dev/null +++ b/sdk/dotnet/Inputs/DatabasePartitionTemplateGetArgs.cs @@ -0,0 +1,33 @@ +// *** 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! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; +using Pulumi; + +namespace KomminarLabs.InfluxDB3.Inputs +{ + + public sealed class DatabasePartitionTemplateGetArgs : global::Pulumi.ResourceArgs + { + /// + /// The type of template part. Valid values are `bucket`, `tag` or `time`. + /// + [Input("type", required: true)] + public Input Type { get; set; } = null!; + + /// + /// The value of template part. **Note:** For `bucket` partition template type use `jsonencode()` function to encode the value to a string. + /// + [Input("value", required: true)] + public Input Value { get; set; } = null!; + + public DatabasePartitionTemplateGetArgs() + { + } + public static new DatabasePartitionTemplateGetArgs Empty => new DatabasePartitionTemplateGetArgs(); + } +} diff --git a/sdk/dotnet/Outputs/DatabasePartitionTemplate.cs b/sdk/dotnet/Outputs/DatabasePartitionTemplate.cs new file mode 100644 index 0000000..2f1b67f --- /dev/null +++ b/sdk/dotnet/Outputs/DatabasePartitionTemplate.cs @@ -0,0 +1,36 @@ +// *** 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! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; +using Pulumi; + +namespace KomminarLabs.InfluxDB3.Outputs +{ + + [OutputType] + public sealed class DatabasePartitionTemplate + { + /// + /// The type of template part. Valid values are `bucket`, `tag` or `time`. + /// + public readonly string Type; + /// + /// The value of template part. **Note:** For `bucket` partition template type use `jsonencode()` function to encode the value to a string. + /// + public readonly string Value; + + [OutputConstructor] + private DatabasePartitionTemplate( + string type, + + string value) + { + Type = type; + Value = value; + } + } +} diff --git a/sdk/dotnet/Outputs/GetDatabasePartitionTemplateResult.cs b/sdk/dotnet/Outputs/GetDatabasePartitionTemplateResult.cs new file mode 100644 index 0000000..01c7999 --- /dev/null +++ b/sdk/dotnet/Outputs/GetDatabasePartitionTemplateResult.cs @@ -0,0 +1,36 @@ +// *** 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! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; +using Pulumi; + +namespace KomminarLabs.InfluxDB3.Outputs +{ + + [OutputType] + public sealed class GetDatabasePartitionTemplateResult + { + /// + /// The type of template part. + /// + public readonly string Type; + /// + /// The value of template part. + /// + public readonly string Value; + + [OutputConstructor] + private GetDatabasePartitionTemplateResult( + string type, + + string value) + { + Type = type; + Value = value; + } + } +} diff --git a/sdk/dotnet/Outputs/GetDatabasesDatabasePartitionTemplateResult.cs b/sdk/dotnet/Outputs/GetDatabasesDatabasePartitionTemplateResult.cs new file mode 100644 index 0000000..ce3bd04 --- /dev/null +++ b/sdk/dotnet/Outputs/GetDatabasesDatabasePartitionTemplateResult.cs @@ -0,0 +1,36 @@ +// *** 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! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; +using Pulumi; + +namespace KomminarLabs.InfluxDB3.Outputs +{ + + [OutputType] + public sealed class GetDatabasesDatabasePartitionTemplateResult + { + /// + /// The type of template part. + /// + public readonly string Type; + /// + /// The value of template part. + /// + public readonly string Value; + + [OutputConstructor] + private GetDatabasesDatabasePartitionTemplateResult( + string type, + + string value) + { + Type = type; + Value = value; + } + } +} diff --git a/sdk/dotnet/Outputs/GetDatabasesDatabaseResult.cs b/sdk/dotnet/Outputs/GetDatabasesDatabaseResult.cs index 193b56e..2c0aaa9 100644 --- a/sdk/dotnet/Outputs/GetDatabasesDatabaseResult.cs +++ b/sdk/dotnet/Outputs/GetDatabasesDatabaseResult.cs @@ -35,6 +35,10 @@ public sealed class GetDatabasesDatabaseResult /// public readonly string Name; /// + /// The template partitioning of the cluster database. + /// + public readonly ImmutableArray PartitionTemplates; + /// /// The retention period of the cluster database in nanoseconds. /// public readonly int RetentionPeriod; @@ -51,6 +55,8 @@ private GetDatabasesDatabaseResult( string name, + ImmutableArray partitionTemplates, + int retentionPeriod) { AccountId = accountId; @@ -58,6 +64,7 @@ private GetDatabasesDatabaseResult( MaxColumnsPerTable = maxColumnsPerTable; MaxTables = maxTables; Name = name; + PartitionTemplates = partitionTemplates; RetentionPeriod = retentionPeriod; } } diff --git a/sdk/dotnet/version.txt b/sdk/dotnet/version.txt index 9a8915b..836a1e4 100644 --- a/sdk/dotnet/version.txt +++ b/sdk/dotnet/version.txt @@ -1 +1 @@ -1.0.0+dirty +1.1.0-alpha.1723580008+1a720995.dirty diff --git a/sdk/go/influxdb3/database.go b/sdk/go/influxdb3/database.go index e600ae3..66a99c7 100644 --- a/sdk/go/influxdb3/database.go +++ b/sdk/go/influxdb3/database.go @@ -12,6 +12,60 @@ import ( ) // Creates and manages a database. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/json" +// +// "github.com/komminarlabs/pulumi-influxdb3/sdk/go/influxdb3" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// tmpJSON0, err := json.Marshal(map[string]interface{}{ +// "tagName": "temperature", +// "numberOfBuckets": 10, +// }) +// if err != nil { +// return err +// } +// json0 := string(tmpJSON0) +// _, err = influxdb3.NewDatabase(ctx, "signals", &influxdb3.DatabaseArgs{ +// RetentionPeriod: pulumi.Int(604800), +// PartitionTemplates: influxdb3.DatabasePartitionTemplateArray{ +// &influxdb3.DatabasePartitionTemplateArgs{ +// Type: pulumi.String("tag"), +// Value: pulumi.String("line"), +// }, +// &influxdb3.DatabasePartitionTemplateArgs{ +// Type: pulumi.String("tag"), +// Value: pulumi.String("station"), +// }, +// &influxdb3.DatabasePartitionTemplateArgs{ +// Type: pulumi.String("time"), +// Value: pulumi.String("%Y-%m-%d"), +// }, +// &influxdb3.DatabasePartitionTemplateArgs{ +// Type: pulumi.String("bucket"), +// Value: pulumi.String(json0), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` type Database struct { pulumi.CustomResourceState @@ -23,8 +77,10 @@ type Database struct { MaxColumnsPerTable pulumi.IntOutput `pulumi:"maxColumnsPerTable"` // The maximum number of tables for the cluster database. The default is `500` MaxTables pulumi.IntOutput `pulumi:"maxTables"` - // The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + // The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. Name pulumi.StringOutput `pulumi:"name"` + // A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement. + PartitionTemplates DatabasePartitionTemplateArrayOutput `pulumi:"partitionTemplates"` // The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention. RetentionPeriod pulumi.IntOutput `pulumi:"retentionPeriod"` } @@ -67,8 +123,10 @@ type databaseState struct { MaxColumnsPerTable *int `pulumi:"maxColumnsPerTable"` // The maximum number of tables for the cluster database. The default is `500` MaxTables *int `pulumi:"maxTables"` - // The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + // The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. Name *string `pulumi:"name"` + // A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement. + PartitionTemplates []DatabasePartitionTemplate `pulumi:"partitionTemplates"` // The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention. RetentionPeriod *int `pulumi:"retentionPeriod"` } @@ -82,8 +140,10 @@ type DatabaseState struct { MaxColumnsPerTable pulumi.IntPtrInput // The maximum number of tables for the cluster database. The default is `500` MaxTables pulumi.IntPtrInput - // The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + // The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. Name pulumi.StringPtrInput + // A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement. + PartitionTemplates DatabasePartitionTemplateArrayInput // The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention. RetentionPeriod pulumi.IntPtrInput } @@ -97,8 +157,10 @@ type databaseArgs struct { MaxColumnsPerTable *int `pulumi:"maxColumnsPerTable"` // The maximum number of tables for the cluster database. The default is `500` MaxTables *int `pulumi:"maxTables"` - // The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + // The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. Name *string `pulumi:"name"` + // A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement. + PartitionTemplates []DatabasePartitionTemplate `pulumi:"partitionTemplates"` // The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention. RetentionPeriod *int `pulumi:"retentionPeriod"` } @@ -109,8 +171,10 @@ type DatabaseArgs struct { MaxColumnsPerTable pulumi.IntPtrInput // The maximum number of tables for the cluster database. The default is `500` MaxTables pulumi.IntPtrInput - // The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + // The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. Name pulumi.StringPtrInput + // A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement. + PartitionTemplates DatabasePartitionTemplateArrayInput // The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention. RetentionPeriod pulumi.IntPtrInput } @@ -222,11 +286,16 @@ func (o DatabaseOutput) MaxTables() pulumi.IntOutput { return o.ApplyT(func(v *Database) pulumi.IntOutput { return v.MaxTables }).(pulumi.IntOutput) } -// The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. +// The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. func (o DatabaseOutput) Name() pulumi.StringOutput { return o.ApplyT(func(v *Database) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) } +// A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement. +func (o DatabaseOutput) PartitionTemplates() DatabasePartitionTemplateArrayOutput { + return o.ApplyT(func(v *Database) DatabasePartitionTemplateArrayOutput { return v.PartitionTemplates }).(DatabasePartitionTemplateArrayOutput) +} + // The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention. func (o DatabaseOutput) RetentionPeriod() pulumi.IntOutput { return o.ApplyT(func(v *Database) pulumi.IntOutput { return v.RetentionPeriod }).(pulumi.IntOutput) diff --git a/sdk/go/influxdb3/getDatabase.go b/sdk/go/influxdb3/getDatabase.go index b511647..a6601eb 100644 --- a/sdk/go/influxdb3/getDatabase.go +++ b/sdk/go/influxdb3/getDatabase.go @@ -42,6 +42,8 @@ type LookupDatabaseResult struct { MaxTables int `pulumi:"maxTables"` // The name of the cluster database. Name string `pulumi:"name"` + // The template partitioning of the cluster database. + PartitionTemplates []GetDatabasePartitionTemplate `pulumi:"partitionTemplates"` // The retention period of the cluster database in nanoseconds. RetentionPeriod int `pulumi:"retentionPeriod"` } @@ -114,6 +116,11 @@ func (o LookupDatabaseResultOutput) Name() pulumi.StringOutput { return o.ApplyT(func(v LookupDatabaseResult) string { return v.Name }).(pulumi.StringOutput) } +// The template partitioning of the cluster database. +func (o LookupDatabaseResultOutput) PartitionTemplates() GetDatabasePartitionTemplateArrayOutput { + return o.ApplyT(func(v LookupDatabaseResult) []GetDatabasePartitionTemplate { return v.PartitionTemplates }).(GetDatabasePartitionTemplateArrayOutput) +} + // The retention period of the cluster database in nanoseconds. func (o LookupDatabaseResultOutput) RetentionPeriod() pulumi.IntOutput { return o.ApplyT(func(v LookupDatabaseResult) int { return v.RetentionPeriod }).(pulumi.IntOutput) diff --git a/sdk/go/influxdb3/pulumiTypes.go b/sdk/go/influxdb3/pulumiTypes.go index 21f2b30..69a31ea 100644 --- a/sdk/go/influxdb3/pulumiTypes.go +++ b/sdk/go/influxdb3/pulumiTypes.go @@ -13,6 +13,112 @@ import ( var _ = internal.GetEnvOrDefault +type DatabasePartitionTemplate struct { + // The type of template part. Valid values are `bucket`, `tag` or `time`. + Type string `pulumi:"type"` + // The value of template part. **Note:** For `bucket` partition template type use `jsonencode()` function to encode the value to a string. + Value string `pulumi:"value"` +} + +// DatabasePartitionTemplateInput is an input type that accepts DatabasePartitionTemplateArgs and DatabasePartitionTemplateOutput values. +// You can construct a concrete instance of `DatabasePartitionTemplateInput` via: +// +// DatabasePartitionTemplateArgs{...} +type DatabasePartitionTemplateInput interface { + pulumi.Input + + ToDatabasePartitionTemplateOutput() DatabasePartitionTemplateOutput + ToDatabasePartitionTemplateOutputWithContext(context.Context) DatabasePartitionTemplateOutput +} + +type DatabasePartitionTemplateArgs struct { + // The type of template part. Valid values are `bucket`, `tag` or `time`. + Type pulumi.StringInput `pulumi:"type"` + // The value of template part. **Note:** For `bucket` partition template type use `jsonencode()` function to encode the value to a string. + Value pulumi.StringInput `pulumi:"value"` +} + +func (DatabasePartitionTemplateArgs) ElementType() reflect.Type { + return reflect.TypeOf((*DatabasePartitionTemplate)(nil)).Elem() +} + +func (i DatabasePartitionTemplateArgs) ToDatabasePartitionTemplateOutput() DatabasePartitionTemplateOutput { + return i.ToDatabasePartitionTemplateOutputWithContext(context.Background()) +} + +func (i DatabasePartitionTemplateArgs) ToDatabasePartitionTemplateOutputWithContext(ctx context.Context) DatabasePartitionTemplateOutput { + return pulumi.ToOutputWithContext(ctx, i).(DatabasePartitionTemplateOutput) +} + +// DatabasePartitionTemplateArrayInput is an input type that accepts DatabasePartitionTemplateArray and DatabasePartitionTemplateArrayOutput values. +// You can construct a concrete instance of `DatabasePartitionTemplateArrayInput` via: +// +// DatabasePartitionTemplateArray{ DatabasePartitionTemplateArgs{...} } +type DatabasePartitionTemplateArrayInput interface { + pulumi.Input + + ToDatabasePartitionTemplateArrayOutput() DatabasePartitionTemplateArrayOutput + ToDatabasePartitionTemplateArrayOutputWithContext(context.Context) DatabasePartitionTemplateArrayOutput +} + +type DatabasePartitionTemplateArray []DatabasePartitionTemplateInput + +func (DatabasePartitionTemplateArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]DatabasePartitionTemplate)(nil)).Elem() +} + +func (i DatabasePartitionTemplateArray) ToDatabasePartitionTemplateArrayOutput() DatabasePartitionTemplateArrayOutput { + return i.ToDatabasePartitionTemplateArrayOutputWithContext(context.Background()) +} + +func (i DatabasePartitionTemplateArray) ToDatabasePartitionTemplateArrayOutputWithContext(ctx context.Context) DatabasePartitionTemplateArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(DatabasePartitionTemplateArrayOutput) +} + +type DatabasePartitionTemplateOutput struct{ *pulumi.OutputState } + +func (DatabasePartitionTemplateOutput) ElementType() reflect.Type { + return reflect.TypeOf((*DatabasePartitionTemplate)(nil)).Elem() +} + +func (o DatabasePartitionTemplateOutput) ToDatabasePartitionTemplateOutput() DatabasePartitionTemplateOutput { + return o +} + +func (o DatabasePartitionTemplateOutput) ToDatabasePartitionTemplateOutputWithContext(ctx context.Context) DatabasePartitionTemplateOutput { + return o +} + +// The type of template part. Valid values are `bucket`, `tag` or `time`. +func (o DatabasePartitionTemplateOutput) Type() pulumi.StringOutput { + return o.ApplyT(func(v DatabasePartitionTemplate) string { return v.Type }).(pulumi.StringOutput) +} + +// The value of template part. **Note:** For `bucket` partition template type use `jsonencode()` function to encode the value to a string. +func (o DatabasePartitionTemplateOutput) Value() pulumi.StringOutput { + return o.ApplyT(func(v DatabasePartitionTemplate) string { return v.Value }).(pulumi.StringOutput) +} + +type DatabasePartitionTemplateArrayOutput struct{ *pulumi.OutputState } + +func (DatabasePartitionTemplateArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]DatabasePartitionTemplate)(nil)).Elem() +} + +func (o DatabasePartitionTemplateArrayOutput) ToDatabasePartitionTemplateArrayOutput() DatabasePartitionTemplateArrayOutput { + return o +} + +func (o DatabasePartitionTemplateArrayOutput) ToDatabasePartitionTemplateArrayOutputWithContext(ctx context.Context) DatabasePartitionTemplateArrayOutput { + return o +} + +func (o DatabasePartitionTemplateArrayOutput) Index(i pulumi.IntInput) DatabasePartitionTemplateOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) DatabasePartitionTemplate { + return vs[0].([]DatabasePartitionTemplate)[vs[1].(int)] + }).(DatabasePartitionTemplateOutput) +} + type TokenPermission struct { // The action the database token permission allows. Valid values are `read` or `write`. Action string `pulumi:"action"` @@ -119,6 +225,112 @@ func (o TokenPermissionArrayOutput) Index(i pulumi.IntInput) TokenPermissionOutp }).(TokenPermissionOutput) } +type GetDatabasePartitionTemplate struct { + // The type of template part. + Type string `pulumi:"type"` + // The value of template part. + Value string `pulumi:"value"` +} + +// GetDatabasePartitionTemplateInput is an input type that accepts GetDatabasePartitionTemplateArgs and GetDatabasePartitionTemplateOutput values. +// You can construct a concrete instance of `GetDatabasePartitionTemplateInput` via: +// +// GetDatabasePartitionTemplateArgs{...} +type GetDatabasePartitionTemplateInput interface { + pulumi.Input + + ToGetDatabasePartitionTemplateOutput() GetDatabasePartitionTemplateOutput + ToGetDatabasePartitionTemplateOutputWithContext(context.Context) GetDatabasePartitionTemplateOutput +} + +type GetDatabasePartitionTemplateArgs struct { + // The type of template part. + Type pulumi.StringInput `pulumi:"type"` + // The value of template part. + Value pulumi.StringInput `pulumi:"value"` +} + +func (GetDatabasePartitionTemplateArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetDatabasePartitionTemplate)(nil)).Elem() +} + +func (i GetDatabasePartitionTemplateArgs) ToGetDatabasePartitionTemplateOutput() GetDatabasePartitionTemplateOutput { + return i.ToGetDatabasePartitionTemplateOutputWithContext(context.Background()) +} + +func (i GetDatabasePartitionTemplateArgs) ToGetDatabasePartitionTemplateOutputWithContext(ctx context.Context) GetDatabasePartitionTemplateOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetDatabasePartitionTemplateOutput) +} + +// GetDatabasePartitionTemplateArrayInput is an input type that accepts GetDatabasePartitionTemplateArray and GetDatabasePartitionTemplateArrayOutput values. +// You can construct a concrete instance of `GetDatabasePartitionTemplateArrayInput` via: +// +// GetDatabasePartitionTemplateArray{ GetDatabasePartitionTemplateArgs{...} } +type GetDatabasePartitionTemplateArrayInput interface { + pulumi.Input + + ToGetDatabasePartitionTemplateArrayOutput() GetDatabasePartitionTemplateArrayOutput + ToGetDatabasePartitionTemplateArrayOutputWithContext(context.Context) GetDatabasePartitionTemplateArrayOutput +} + +type GetDatabasePartitionTemplateArray []GetDatabasePartitionTemplateInput + +func (GetDatabasePartitionTemplateArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetDatabasePartitionTemplate)(nil)).Elem() +} + +func (i GetDatabasePartitionTemplateArray) ToGetDatabasePartitionTemplateArrayOutput() GetDatabasePartitionTemplateArrayOutput { + return i.ToGetDatabasePartitionTemplateArrayOutputWithContext(context.Background()) +} + +func (i GetDatabasePartitionTemplateArray) ToGetDatabasePartitionTemplateArrayOutputWithContext(ctx context.Context) GetDatabasePartitionTemplateArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetDatabasePartitionTemplateArrayOutput) +} + +type GetDatabasePartitionTemplateOutput struct{ *pulumi.OutputState } + +func (GetDatabasePartitionTemplateOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetDatabasePartitionTemplate)(nil)).Elem() +} + +func (o GetDatabasePartitionTemplateOutput) ToGetDatabasePartitionTemplateOutput() GetDatabasePartitionTemplateOutput { + return o +} + +func (o GetDatabasePartitionTemplateOutput) ToGetDatabasePartitionTemplateOutputWithContext(ctx context.Context) GetDatabasePartitionTemplateOutput { + return o +} + +// The type of template part. +func (o GetDatabasePartitionTemplateOutput) Type() pulumi.StringOutput { + return o.ApplyT(func(v GetDatabasePartitionTemplate) string { return v.Type }).(pulumi.StringOutput) +} + +// The value of template part. +func (o GetDatabasePartitionTemplateOutput) Value() pulumi.StringOutput { + return o.ApplyT(func(v GetDatabasePartitionTemplate) string { return v.Value }).(pulumi.StringOutput) +} + +type GetDatabasePartitionTemplateArrayOutput struct{ *pulumi.OutputState } + +func (GetDatabasePartitionTemplateArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetDatabasePartitionTemplate)(nil)).Elem() +} + +func (o GetDatabasePartitionTemplateArrayOutput) ToGetDatabasePartitionTemplateArrayOutput() GetDatabasePartitionTemplateArrayOutput { + return o +} + +func (o GetDatabasePartitionTemplateArrayOutput) ToGetDatabasePartitionTemplateArrayOutputWithContext(ctx context.Context) GetDatabasePartitionTemplateArrayOutput { + return o +} + +func (o GetDatabasePartitionTemplateArrayOutput) Index(i pulumi.IntInput) GetDatabasePartitionTemplateOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) GetDatabasePartitionTemplate { + return vs[0].([]GetDatabasePartitionTemplate)[vs[1].(int)] + }).(GetDatabasePartitionTemplateOutput) +} + type GetDatabasesDatabase struct { // The ID of the account that the cluster belongs to. AccountId string `pulumi:"accountId"` @@ -130,6 +342,8 @@ type GetDatabasesDatabase struct { MaxTables int `pulumi:"maxTables"` // The name of the cluster database. Name string `pulumi:"name"` + // The template partitioning of the cluster database. + PartitionTemplates []GetDatabasesDatabasePartitionTemplate `pulumi:"partitionTemplates"` // The retention period of the cluster database in nanoseconds. RetentionPeriod int `pulumi:"retentionPeriod"` } @@ -156,6 +370,8 @@ type GetDatabasesDatabaseArgs struct { MaxTables pulumi.IntInput `pulumi:"maxTables"` // The name of the cluster database. Name pulumi.StringInput `pulumi:"name"` + // The template partitioning of the cluster database. + PartitionTemplates GetDatabasesDatabasePartitionTemplateArrayInput `pulumi:"partitionTemplates"` // The retention period of the cluster database in nanoseconds. RetentionPeriod pulumi.IntInput `pulumi:"retentionPeriod"` } @@ -236,6 +452,11 @@ func (o GetDatabasesDatabaseOutput) Name() pulumi.StringOutput { return o.ApplyT(func(v GetDatabasesDatabase) string { return v.Name }).(pulumi.StringOutput) } +// The template partitioning of the cluster database. +func (o GetDatabasesDatabaseOutput) PartitionTemplates() GetDatabasesDatabasePartitionTemplateArrayOutput { + return o.ApplyT(func(v GetDatabasesDatabase) []GetDatabasesDatabasePartitionTemplate { return v.PartitionTemplates }).(GetDatabasesDatabasePartitionTemplateArrayOutput) +} + // The retention period of the cluster database in nanoseconds. func (o GetDatabasesDatabaseOutput) RetentionPeriod() pulumi.IntOutput { return o.ApplyT(func(v GetDatabasesDatabase) int { return v.RetentionPeriod }).(pulumi.IntOutput) @@ -261,6 +482,112 @@ func (o GetDatabasesDatabaseArrayOutput) Index(i pulumi.IntInput) GetDatabasesDa }).(GetDatabasesDatabaseOutput) } +type GetDatabasesDatabasePartitionTemplate struct { + // The type of template part. + Type string `pulumi:"type"` + // The value of template part. + Value string `pulumi:"value"` +} + +// GetDatabasesDatabasePartitionTemplateInput is an input type that accepts GetDatabasesDatabasePartitionTemplateArgs and GetDatabasesDatabasePartitionTemplateOutput values. +// You can construct a concrete instance of `GetDatabasesDatabasePartitionTemplateInput` via: +// +// GetDatabasesDatabasePartitionTemplateArgs{...} +type GetDatabasesDatabasePartitionTemplateInput interface { + pulumi.Input + + ToGetDatabasesDatabasePartitionTemplateOutput() GetDatabasesDatabasePartitionTemplateOutput + ToGetDatabasesDatabasePartitionTemplateOutputWithContext(context.Context) GetDatabasesDatabasePartitionTemplateOutput +} + +type GetDatabasesDatabasePartitionTemplateArgs struct { + // The type of template part. + Type pulumi.StringInput `pulumi:"type"` + // The value of template part. + Value pulumi.StringInput `pulumi:"value"` +} + +func (GetDatabasesDatabasePartitionTemplateArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetDatabasesDatabasePartitionTemplate)(nil)).Elem() +} + +func (i GetDatabasesDatabasePartitionTemplateArgs) ToGetDatabasesDatabasePartitionTemplateOutput() GetDatabasesDatabasePartitionTemplateOutput { + return i.ToGetDatabasesDatabasePartitionTemplateOutputWithContext(context.Background()) +} + +func (i GetDatabasesDatabasePartitionTemplateArgs) ToGetDatabasesDatabasePartitionTemplateOutputWithContext(ctx context.Context) GetDatabasesDatabasePartitionTemplateOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetDatabasesDatabasePartitionTemplateOutput) +} + +// GetDatabasesDatabasePartitionTemplateArrayInput is an input type that accepts GetDatabasesDatabasePartitionTemplateArray and GetDatabasesDatabasePartitionTemplateArrayOutput values. +// You can construct a concrete instance of `GetDatabasesDatabasePartitionTemplateArrayInput` via: +// +// GetDatabasesDatabasePartitionTemplateArray{ GetDatabasesDatabasePartitionTemplateArgs{...} } +type GetDatabasesDatabasePartitionTemplateArrayInput interface { + pulumi.Input + + ToGetDatabasesDatabasePartitionTemplateArrayOutput() GetDatabasesDatabasePartitionTemplateArrayOutput + ToGetDatabasesDatabasePartitionTemplateArrayOutputWithContext(context.Context) GetDatabasesDatabasePartitionTemplateArrayOutput +} + +type GetDatabasesDatabasePartitionTemplateArray []GetDatabasesDatabasePartitionTemplateInput + +func (GetDatabasesDatabasePartitionTemplateArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetDatabasesDatabasePartitionTemplate)(nil)).Elem() +} + +func (i GetDatabasesDatabasePartitionTemplateArray) ToGetDatabasesDatabasePartitionTemplateArrayOutput() GetDatabasesDatabasePartitionTemplateArrayOutput { + return i.ToGetDatabasesDatabasePartitionTemplateArrayOutputWithContext(context.Background()) +} + +func (i GetDatabasesDatabasePartitionTemplateArray) ToGetDatabasesDatabasePartitionTemplateArrayOutputWithContext(ctx context.Context) GetDatabasesDatabasePartitionTemplateArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetDatabasesDatabasePartitionTemplateArrayOutput) +} + +type GetDatabasesDatabasePartitionTemplateOutput struct{ *pulumi.OutputState } + +func (GetDatabasesDatabasePartitionTemplateOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetDatabasesDatabasePartitionTemplate)(nil)).Elem() +} + +func (o GetDatabasesDatabasePartitionTemplateOutput) ToGetDatabasesDatabasePartitionTemplateOutput() GetDatabasesDatabasePartitionTemplateOutput { + return o +} + +func (o GetDatabasesDatabasePartitionTemplateOutput) ToGetDatabasesDatabasePartitionTemplateOutputWithContext(ctx context.Context) GetDatabasesDatabasePartitionTemplateOutput { + return o +} + +// The type of template part. +func (o GetDatabasesDatabasePartitionTemplateOutput) Type() pulumi.StringOutput { + return o.ApplyT(func(v GetDatabasesDatabasePartitionTemplate) string { return v.Type }).(pulumi.StringOutput) +} + +// The value of template part. +func (o GetDatabasesDatabasePartitionTemplateOutput) Value() pulumi.StringOutput { + return o.ApplyT(func(v GetDatabasesDatabasePartitionTemplate) string { return v.Value }).(pulumi.StringOutput) +} + +type GetDatabasesDatabasePartitionTemplateArrayOutput struct{ *pulumi.OutputState } + +func (GetDatabasesDatabasePartitionTemplateArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetDatabasesDatabasePartitionTemplate)(nil)).Elem() +} + +func (o GetDatabasesDatabasePartitionTemplateArrayOutput) ToGetDatabasesDatabasePartitionTemplateArrayOutput() GetDatabasesDatabasePartitionTemplateArrayOutput { + return o +} + +func (o GetDatabasesDatabasePartitionTemplateArrayOutput) ToGetDatabasesDatabasePartitionTemplateArrayOutputWithContext(ctx context.Context) GetDatabasesDatabasePartitionTemplateArrayOutput { + return o +} + +func (o GetDatabasesDatabasePartitionTemplateArrayOutput) Index(i pulumi.IntInput) GetDatabasesDatabasePartitionTemplateOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) GetDatabasesDatabasePartitionTemplate { + return vs[0].([]GetDatabasesDatabasePartitionTemplate)[vs[1].(int)] + }).(GetDatabasesDatabasePartitionTemplateOutput) +} + type GetTokenPermission struct { // The action the database token permission allows. Action string `pulumi:"action"` @@ -625,20 +952,32 @@ func (o GetTokensTokenPermissionArrayOutput) Index(i pulumi.IntInput) GetTokensT } func init() { + pulumi.RegisterInputType(reflect.TypeOf((*DatabasePartitionTemplateInput)(nil)).Elem(), DatabasePartitionTemplateArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*DatabasePartitionTemplateArrayInput)(nil)).Elem(), DatabasePartitionTemplateArray{}) pulumi.RegisterInputType(reflect.TypeOf((*TokenPermissionInput)(nil)).Elem(), TokenPermissionArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*TokenPermissionArrayInput)(nil)).Elem(), TokenPermissionArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetDatabasePartitionTemplateInput)(nil)).Elem(), GetDatabasePartitionTemplateArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetDatabasePartitionTemplateArrayInput)(nil)).Elem(), GetDatabasePartitionTemplateArray{}) pulumi.RegisterInputType(reflect.TypeOf((*GetDatabasesDatabaseInput)(nil)).Elem(), GetDatabasesDatabaseArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*GetDatabasesDatabaseArrayInput)(nil)).Elem(), GetDatabasesDatabaseArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetDatabasesDatabasePartitionTemplateInput)(nil)).Elem(), GetDatabasesDatabasePartitionTemplateArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetDatabasesDatabasePartitionTemplateArrayInput)(nil)).Elem(), GetDatabasesDatabasePartitionTemplateArray{}) pulumi.RegisterInputType(reflect.TypeOf((*GetTokenPermissionInput)(nil)).Elem(), GetTokenPermissionArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*GetTokenPermissionArrayInput)(nil)).Elem(), GetTokenPermissionArray{}) pulumi.RegisterInputType(reflect.TypeOf((*GetTokensTokenInput)(nil)).Elem(), GetTokensTokenArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*GetTokensTokenArrayInput)(nil)).Elem(), GetTokensTokenArray{}) pulumi.RegisterInputType(reflect.TypeOf((*GetTokensTokenPermissionInput)(nil)).Elem(), GetTokensTokenPermissionArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*GetTokensTokenPermissionArrayInput)(nil)).Elem(), GetTokensTokenPermissionArray{}) + pulumi.RegisterOutputType(DatabasePartitionTemplateOutput{}) + pulumi.RegisterOutputType(DatabasePartitionTemplateArrayOutput{}) pulumi.RegisterOutputType(TokenPermissionOutput{}) pulumi.RegisterOutputType(TokenPermissionArrayOutput{}) + pulumi.RegisterOutputType(GetDatabasePartitionTemplateOutput{}) + pulumi.RegisterOutputType(GetDatabasePartitionTemplateArrayOutput{}) pulumi.RegisterOutputType(GetDatabasesDatabaseOutput{}) pulumi.RegisterOutputType(GetDatabasesDatabaseArrayOutput{}) + pulumi.RegisterOutputType(GetDatabasesDatabasePartitionTemplateOutput{}) + pulumi.RegisterOutputType(GetDatabasesDatabasePartitionTemplateArrayOutput{}) pulumi.RegisterOutputType(GetTokenPermissionOutput{}) pulumi.RegisterOutputType(GetTokenPermissionArrayOutput{}) pulumi.RegisterOutputType(GetTokensTokenOutput{}) diff --git a/sdk/nodejs/database.ts b/sdk/nodejs/database.ts index 5321e5f..31f84ce 100644 --- a/sdk/nodejs/database.ts +++ b/sdk/nodejs/database.ts @@ -2,10 +2,44 @@ // *** Do not edit by hand unless you're certain you know what you are doing! *** import * as pulumi from "@pulumi/pulumi"; +import * as inputs from "./types/input"; +import * as outputs from "./types/output"; import * as utilities from "./utilities"; /** * Creates and manages a database. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as influxdb3 from "@komminarlabs/influxdb3"; + * + * const signals = new influxdb3.Database("signals", { + * retentionPeriod: 604800, + * partitionTemplates: [ + * { + * type: "tag", + * value: "line", + * }, + * { + * type: "tag", + * value: "station", + * }, + * { + * type: "time", + * value: "%Y-%m-%d", + * }, + * { + * type: "bucket", + * value: JSON.stringify({ + * tagName: "temperature", + * numberOfBuckets: 10, + * }), + * }, + * ], + * }); + * ``` */ export class Database extends pulumi.CustomResource { /** @@ -52,9 +86,13 @@ export class Database extends pulumi.CustomResource { */ public readonly maxTables!: pulumi.Output; /** - * The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + * The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. */ public readonly name!: pulumi.Output; + /** + * A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement. + */ + public readonly partitionTemplates!: pulumi.Output; /** * The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention. */ @@ -78,12 +116,14 @@ export class Database extends pulumi.CustomResource { resourceInputs["maxColumnsPerTable"] = state ? state.maxColumnsPerTable : undefined; resourceInputs["maxTables"] = state ? state.maxTables : undefined; resourceInputs["name"] = state ? state.name : undefined; + resourceInputs["partitionTemplates"] = state ? state.partitionTemplates : undefined; resourceInputs["retentionPeriod"] = state ? state.retentionPeriod : undefined; } else { const args = argsOrState as DatabaseArgs | undefined; resourceInputs["maxColumnsPerTable"] = args ? args.maxColumnsPerTable : undefined; resourceInputs["maxTables"] = args ? args.maxTables : undefined; resourceInputs["name"] = args ? args.name : undefined; + resourceInputs["partitionTemplates"] = args ? args.partitionTemplates : undefined; resourceInputs["retentionPeriod"] = args ? args.retentionPeriod : undefined; resourceInputs["accountId"] = undefined /*out*/; resourceInputs["clusterId"] = undefined /*out*/; @@ -114,9 +154,13 @@ export interface DatabaseState { */ maxTables?: pulumi.Input; /** - * The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + * The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. */ name?: pulumi.Input; + /** + * A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement. + */ + partitionTemplates?: pulumi.Input[]>; /** * The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention. */ @@ -136,9 +180,13 @@ export interface DatabaseArgs { */ maxTables?: pulumi.Input; /** - * The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + * The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. */ name?: pulumi.Input; + /** + * A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement. + */ + partitionTemplates?: pulumi.Input[]>; /** * The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention. */ diff --git a/sdk/nodejs/getDatabase.ts b/sdk/nodejs/getDatabase.ts index 2446311..a1421d2 100644 --- a/sdk/nodejs/getDatabase.ts +++ b/sdk/nodejs/getDatabase.ts @@ -2,6 +2,8 @@ // *** Do not edit by hand unless you're certain you know what you are doing! *** import * as pulumi from "@pulumi/pulumi"; +import * as inputs from "./types/input"; +import * as outputs from "./types/output"; import * as utilities from "./utilities"; /** @@ -53,6 +55,10 @@ export interface GetDatabaseResult { * The name of the cluster database. */ readonly name: string; + /** + * The template partitioning of the cluster database. + */ + readonly partitionTemplates: outputs.GetDatabasePartitionTemplate[]; /** * The retention period of the cluster database in nanoseconds. */ diff --git a/sdk/nodejs/types/input.ts b/sdk/nodejs/types/input.ts index 7587f27..fbe6eb8 100644 --- a/sdk/nodejs/types/input.ts +++ b/sdk/nodejs/types/input.ts @@ -5,6 +5,17 @@ import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; +export interface DatabasePartitionTemplate { + /** + * The type of template part. Valid values are `bucket`, `tag` or `time`. + */ + type: pulumi.Input; + /** + * The value of template part. **Note:** For `bucket` partition template type use `jsonencode()` function to encode the value to a string. + */ + value: pulumi.Input; +} + export interface TokenPermission { /** * The action the database token permission allows. Valid values are `read` or `write`. diff --git a/sdk/nodejs/types/output.ts b/sdk/nodejs/types/output.ts index 4debf26..aa7081c 100644 --- a/sdk/nodejs/types/output.ts +++ b/sdk/nodejs/types/output.ts @@ -5,6 +5,28 @@ import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; +export interface DatabasePartitionTemplate { + /** + * The type of template part. Valid values are `bucket`, `tag` or `time`. + */ + type: string; + /** + * The value of template part. **Note:** For `bucket` partition template type use `jsonencode()` function to encode the value to a string. + */ + value: string; +} + +export interface GetDatabasePartitionTemplate { + /** + * The type of template part. + */ + type: string; + /** + * The value of template part. + */ + value: string; +} + export interface GetDatabasesDatabase { /** * The ID of the account that the cluster belongs to. @@ -26,12 +48,27 @@ export interface GetDatabasesDatabase { * The name of the cluster database. */ name: string; + /** + * The template partitioning of the cluster database. + */ + partitionTemplates: outputs.GetDatabasesDatabasePartitionTemplate[]; /** * The retention period of the cluster database in nanoseconds. */ retentionPeriod: number; } +export interface GetDatabasesDatabasePartitionTemplate { + /** + * The type of template part. + */ + type: string; + /** + * The value of template part. + */ + value: string; +} + export interface GetTokenPermission { /** * The action the database token permission allows. diff --git a/sdk/nodejs/yarn.lock b/sdk/nodejs/yarn.lock index 04ea2ca..1a782f6 100644 --- a/sdk/nodejs/yarn.lock +++ b/sdk/nodejs/yarn.lock @@ -509,11 +509,11 @@ integrity sha512-Jus9s4CDbqwocc5pOAnh8ShfrnMcPHuJYzVcSUU7lrh8Ni5HuIqX3oilL86p3dlTrk0LzHRCgA/GQ7uNCw6l2Q== "@types/node@*", "@types/node@>=13.7.0": - version "22.2.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.2.0.tgz#7cf046a99f0ba4d628ad3088cb21f790df9b0c5b" - integrity sha512-bm6EG6/pCpkxDf/0gDNDdtDILMOHgaQBVOJGdwsqClnxA3xL6jtMv76rLBc006RVMWbmaf0xbmom4Z/5o2nRkQ== + version "22.5.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.5.0.tgz#10f01fe9465166b4cab72e75f60d8b99d019f958" + integrity sha512-DkFrJOe+rfdHTqqMg0bSNlGlQ85hSoh2TPzZyhHsXnMtligRWpxUySiyw8FY14ITt24HVCiQPWxS3KO/QlGmWg== dependencies: - undici-types "~6.13.0" + undici-types "~6.19.2" "@types/node@^10.0.0": version "10.17.60" @@ -1719,9 +1719,9 @@ spdx-expression-parse@^3.0.0: spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.18" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.18.tgz#22aa922dcf2f2885a6494a261f2d8b75345d0326" - integrity sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ== + version "3.0.20" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.20.tgz#e44ed19ed318dd1e5888f93325cee800f0f51b89" + integrity sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw== sprintf-js@^1.1.3: version "1.1.3" @@ -1818,10 +1818,10 @@ typescript@^4.3.5: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== -undici-types@~6.13.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.13.0.tgz#e3e79220ab8c81ed1496b5812471afd7cf075ea5" - integrity sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg== +undici-types@~6.19.2: + version "6.19.8" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" + integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== unique-filename@^3.0.0: version "3.0.0" diff --git a/sdk/python/komminarlabs_influxdb3/_inputs.py b/sdk/python/komminarlabs_influxdb3/_inputs.py index 608a841..dace379 100644 --- a/sdk/python/komminarlabs_influxdb3/_inputs.py +++ b/sdk/python/komminarlabs_influxdb3/_inputs.py @@ -10,9 +10,47 @@ from . import _utilities __all__ = [ + 'DatabasePartitionTemplateArgs', 'TokenPermissionArgs', ] +@pulumi.input_type +class DatabasePartitionTemplateArgs: + def __init__(__self__, *, + type: pulumi.Input[str], + value: pulumi.Input[str]): + """ + :param pulumi.Input[str] type: The type of template part. Valid values are `bucket`, `tag` or `time`. + :param pulumi.Input[str] value: The value of template part. **Note:** For `bucket` partition template type use `jsonencode()` function to encode the value to a string. + """ + pulumi.set(__self__, "type", type) + pulumi.set(__self__, "value", value) + + @property + @pulumi.getter + def type(self) -> pulumi.Input[str]: + """ + The type of template part. Valid values are `bucket`, `tag` or `time`. + """ + return pulumi.get(self, "type") + + @type.setter + def type(self, value: pulumi.Input[str]): + pulumi.set(self, "type", value) + + @property + @pulumi.getter + def value(self) -> pulumi.Input[str]: + """ + The value of template part. **Note:** For `bucket` partition template type use `jsonencode()` function to encode the value to a string. + """ + return pulumi.get(self, "value") + + @value.setter + def value(self, value: pulumi.Input[str]): + pulumi.set(self, "value", value) + + @pulumi.input_type class TokenPermissionArgs: def __init__(__self__, *, diff --git a/sdk/python/komminarlabs_influxdb3/database.py b/sdk/python/komminarlabs_influxdb3/database.py index d8a6522..78f661c 100644 --- a/sdk/python/komminarlabs_influxdb3/database.py +++ b/sdk/python/komminarlabs_influxdb3/database.py @@ -8,6 +8,8 @@ import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import _utilities +from . import outputs +from ._inputs import * __all__ = ['DatabaseArgs', 'Database'] @@ -17,12 +19,14 @@ def __init__(__self__, *, max_columns_per_table: Optional[pulumi.Input[int]] = None, max_tables: Optional[pulumi.Input[int]] = None, name: Optional[pulumi.Input[str]] = None, + partition_templates: Optional[pulumi.Input[Sequence[pulumi.Input['DatabasePartitionTemplateArgs']]]] = None, retention_period: Optional[pulumi.Input[int]] = None): """ The set of arguments for constructing a Database resource. :param pulumi.Input[int] max_columns_per_table: The maximum number of columns per table for the cluster database. The default is `200` :param pulumi.Input[int] max_tables: The maximum number of tables for the cluster database. The default is `500` - :param pulumi.Input[str] name: The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + :param pulumi.Input[str] name: The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + :param pulumi.Input[Sequence[pulumi.Input['DatabasePartitionTemplateArgs']]] partition_templates: A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement. :param pulumi.Input[int] retention_period: The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention. """ if max_columns_per_table is not None: @@ -31,6 +35,8 @@ def __init__(__self__, *, pulumi.set(__self__, "max_tables", max_tables) if name is not None: pulumi.set(__self__, "name", name) + if partition_templates is not None: + pulumi.set(__self__, "partition_templates", partition_templates) if retention_period is not None: pulumi.set(__self__, "retention_period", retention_period) @@ -62,7 +68,7 @@ def max_tables(self, value: Optional[pulumi.Input[int]]): @pulumi.getter def name(self) -> Optional[pulumi.Input[str]]: """ - The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. """ return pulumi.get(self, "name") @@ -70,6 +76,18 @@ def name(self) -> Optional[pulumi.Input[str]]: def name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "name", value) + @property + @pulumi.getter(name="partitionTemplates") + def partition_templates(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DatabasePartitionTemplateArgs']]]]: + """ + A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement. + """ + return pulumi.get(self, "partition_templates") + + @partition_templates.setter + def partition_templates(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DatabasePartitionTemplateArgs']]]]): + pulumi.set(self, "partition_templates", value) + @property @pulumi.getter(name="retentionPeriod") def retention_period(self) -> Optional[pulumi.Input[int]]: @@ -91,6 +109,7 @@ def __init__(__self__, *, max_columns_per_table: Optional[pulumi.Input[int]] = None, max_tables: Optional[pulumi.Input[int]] = None, name: Optional[pulumi.Input[str]] = None, + partition_templates: Optional[pulumi.Input[Sequence[pulumi.Input['DatabasePartitionTemplateArgs']]]] = None, retention_period: Optional[pulumi.Input[int]] = None): """ Input properties used for looking up and filtering Database resources. @@ -98,7 +117,8 @@ def __init__(__self__, *, :param pulumi.Input[str] cluster_id: The ID of the cluster that you want to manage. :param pulumi.Input[int] max_columns_per_table: The maximum number of columns per table for the cluster database. The default is `200` :param pulumi.Input[int] max_tables: The maximum number of tables for the cluster database. The default is `500` - :param pulumi.Input[str] name: The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + :param pulumi.Input[str] name: The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + :param pulumi.Input[Sequence[pulumi.Input['DatabasePartitionTemplateArgs']]] partition_templates: A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement. :param pulumi.Input[int] retention_period: The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention. """ if account_id is not None: @@ -111,6 +131,8 @@ def __init__(__self__, *, pulumi.set(__self__, "max_tables", max_tables) if name is not None: pulumi.set(__self__, "name", name) + if partition_templates is not None: + pulumi.set(__self__, "partition_templates", partition_templates) if retention_period is not None: pulumi.set(__self__, "retention_period", retention_period) @@ -166,7 +188,7 @@ def max_tables(self, value: Optional[pulumi.Input[int]]): @pulumi.getter def name(self) -> Optional[pulumi.Input[str]]: """ - The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. """ return pulumi.get(self, "name") @@ -174,6 +196,18 @@ def name(self) -> Optional[pulumi.Input[str]]: def name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "name", value) + @property + @pulumi.getter(name="partitionTemplates") + def partition_templates(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DatabasePartitionTemplateArgs']]]]: + """ + A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement. + """ + return pulumi.get(self, "partition_templates") + + @partition_templates.setter + def partition_templates(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DatabasePartitionTemplateArgs']]]]): + pulumi.set(self, "partition_templates", value) + @property @pulumi.getter(name="retentionPeriod") def retention_period(self) -> Optional[pulumi.Input[int]]: @@ -195,16 +229,50 @@ def __init__(__self__, max_columns_per_table: Optional[pulumi.Input[int]] = None, max_tables: Optional[pulumi.Input[int]] = None, name: Optional[pulumi.Input[str]] = None, + partition_templates: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['DatabasePartitionTemplateArgs']]]]] = None, retention_period: Optional[pulumi.Input[int]] = None, __props__=None): """ Creates and manages a database. + ## Example Usage + + ```python + import pulumi + import json + import komminarlabs_influxdb3 as influxdb3 + + signals = influxdb3.Database("signals", + retention_period=604800, + partition_templates=[ + influxdb3.DatabasePartitionTemplateArgs( + type="tag", + value="line", + ), + influxdb3.DatabasePartitionTemplateArgs( + type="tag", + value="station", + ), + influxdb3.DatabasePartitionTemplateArgs( + type="time", + value="%Y-%m-%d", + ), + influxdb3.DatabasePartitionTemplateArgs( + type="bucket", + value=json.dumps({ + "tagName": "temperature", + "numberOfBuckets": 10, + }), + ), + ]) + ``` + :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[int] max_columns_per_table: The maximum number of columns per table for the cluster database. The default is `200` :param pulumi.Input[int] max_tables: The maximum number of tables for the cluster database. The default is `500` - :param pulumi.Input[str] name: The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + :param pulumi.Input[str] name: The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['DatabasePartitionTemplateArgs']]]] partition_templates: A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement. :param pulumi.Input[int] retention_period: The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention. """ ... @@ -216,6 +284,38 @@ def __init__(__self__, """ Creates and manages a database. + ## Example Usage + + ```python + import pulumi + import json + import komminarlabs_influxdb3 as influxdb3 + + signals = influxdb3.Database("signals", + retention_period=604800, + partition_templates=[ + influxdb3.DatabasePartitionTemplateArgs( + type="tag", + value="line", + ), + influxdb3.DatabasePartitionTemplateArgs( + type="tag", + value="station", + ), + influxdb3.DatabasePartitionTemplateArgs( + type="time", + value="%Y-%m-%d", + ), + influxdb3.DatabasePartitionTemplateArgs( + type="bucket", + value=json.dumps({ + "tagName": "temperature", + "numberOfBuckets": 10, + }), + ), + ]) + ``` + :param str resource_name: The name of the resource. :param DatabaseArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. @@ -234,6 +334,7 @@ def _internal_init(__self__, max_columns_per_table: Optional[pulumi.Input[int]] = None, max_tables: Optional[pulumi.Input[int]] = None, name: Optional[pulumi.Input[str]] = None, + partition_templates: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['DatabasePartitionTemplateArgs']]]]] = None, retention_period: Optional[pulumi.Input[int]] = None, __props__=None): opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) @@ -247,6 +348,7 @@ def _internal_init(__self__, __props__.__dict__["max_columns_per_table"] = max_columns_per_table __props__.__dict__["max_tables"] = max_tables __props__.__dict__["name"] = name + __props__.__dict__["partition_templates"] = partition_templates __props__.__dict__["retention_period"] = retention_period __props__.__dict__["account_id"] = None __props__.__dict__["cluster_id"] = None @@ -265,6 +367,7 @@ def get(resource_name: str, max_columns_per_table: Optional[pulumi.Input[int]] = None, max_tables: Optional[pulumi.Input[int]] = None, name: Optional[pulumi.Input[str]] = None, + partition_templates: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['DatabasePartitionTemplateArgs']]]]] = None, retention_period: Optional[pulumi.Input[int]] = None) -> 'Database': """ Get an existing Database resource's state with the given name, id, and optional extra @@ -277,7 +380,8 @@ def get(resource_name: str, :param pulumi.Input[str] cluster_id: The ID of the cluster that you want to manage. :param pulumi.Input[int] max_columns_per_table: The maximum number of columns per table for the cluster database. The default is `200` :param pulumi.Input[int] max_tables: The maximum number of tables for the cluster database. The default is `500` - :param pulumi.Input[str] name: The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + :param pulumi.Input[str] name: The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['DatabasePartitionTemplateArgs']]]] partition_templates: A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement. :param pulumi.Input[int] retention_period: The retention period of the cluster database in nanoseconds. The default is `0`. If the retention period is not set or is set to `0`, the database will have infinite retention. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) @@ -289,6 +393,7 @@ def get(resource_name: str, __props__.__dict__["max_columns_per_table"] = max_columns_per_table __props__.__dict__["max_tables"] = max_tables __props__.__dict__["name"] = name + __props__.__dict__["partition_templates"] = partition_templates __props__.__dict__["retention_period"] = retention_period return Database(resource_name, opts=opts, __props__=__props__) @@ -328,10 +433,18 @@ def max_tables(self) -> pulumi.Output[int]: @pulumi.getter def name(self) -> pulumi.Output[str]: """ - The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. + The name of the cluster database. The Length should be between `[ 1 .. 64 ]` characters. **Note:** Database names can't be updated. An update will result in resource replacement. After a database is deleted, you cannot [reuse](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/delete/#cannot-reuse-database-names) the same name for a new database. """ return pulumi.get(self, "name") + @property + @pulumi.getter(name="partitionTemplates") + def partition_templates(self) -> pulumi.Output[Sequence['outputs.DatabasePartitionTemplate']]: + """ + A template for [partitioning](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/custom-partitions/partition-templates/) a cluster database. **Note:** A partition template can include up to 7 total tag and tag bucket parts and only 1 time part. You can only apply a partition template when creating a database. You [can't update a partition template](https://docs.influxdata.com/influxdb/cloud-dedicated/admin/databases/create/#partition-templates-can-only-be-applied-on-create) on an existing database. An update will result in resource replacement. + """ + return pulumi.get(self, "partition_templates") + @property @pulumi.getter(name="retentionPeriod") def retention_period(self) -> pulumi.Output[int]: diff --git a/sdk/python/komminarlabs_influxdb3/get_database.py b/sdk/python/komminarlabs_influxdb3/get_database.py index 590a12e..60bf401 100644 --- a/sdk/python/komminarlabs_influxdb3/get_database.py +++ b/sdk/python/komminarlabs_influxdb3/get_database.py @@ -8,6 +8,7 @@ import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import _utilities +from . import outputs __all__ = [ 'GetDatabaseResult', @@ -21,7 +22,7 @@ class GetDatabaseResult: """ A collection of values returned by getDatabase. """ - def __init__(__self__, account_id=None, cluster_id=None, id=None, max_columns_per_table=None, max_tables=None, name=None, retention_period=None): + def __init__(__self__, account_id=None, cluster_id=None, id=None, max_columns_per_table=None, max_tables=None, name=None, partition_templates=None, retention_period=None): if account_id and not isinstance(account_id, str): raise TypeError("Expected argument 'account_id' to be a str") pulumi.set(__self__, "account_id", account_id) @@ -40,6 +41,9 @@ def __init__(__self__, account_id=None, cluster_id=None, id=None, max_columns_pe if name and not isinstance(name, str): raise TypeError("Expected argument 'name' to be a str") pulumi.set(__self__, "name", name) + if partition_templates and not isinstance(partition_templates, list): + raise TypeError("Expected argument 'partition_templates' to be a list") + pulumi.set(__self__, "partition_templates", partition_templates) if retention_period and not isinstance(retention_period, int): raise TypeError("Expected argument 'retention_period' to be a int") pulumi.set(__self__, "retention_period", retention_period) @@ -92,6 +96,14 @@ def name(self) -> str: """ return pulumi.get(self, "name") + @property + @pulumi.getter(name="partitionTemplates") + def partition_templates(self) -> Sequence['outputs.GetDatabasePartitionTemplateResult']: + """ + The template partitioning of the cluster database. + """ + return pulumi.get(self, "partition_templates") + @property @pulumi.getter(name="retentionPeriod") def retention_period(self) -> int: @@ -113,6 +125,7 @@ def __await__(self): max_columns_per_table=self.max_columns_per_table, max_tables=self.max_tables, name=self.name, + partition_templates=self.partition_templates, retention_period=self.retention_period) @@ -136,6 +149,7 @@ def get_database(name: Optional[str] = None, max_columns_per_table=pulumi.get(__ret__, 'max_columns_per_table'), max_tables=pulumi.get(__ret__, 'max_tables'), name=pulumi.get(__ret__, 'name'), + partition_templates=pulumi.get(__ret__, 'partition_templates'), retention_period=pulumi.get(__ret__, 'retention_period')) diff --git a/sdk/python/komminarlabs_influxdb3/outputs.py b/sdk/python/komminarlabs_influxdb3/outputs.py index a3eeb31..162c8a1 100644 --- a/sdk/python/komminarlabs_influxdb3/outputs.py +++ b/sdk/python/komminarlabs_influxdb3/outputs.py @@ -11,13 +11,45 @@ from . import outputs __all__ = [ + 'DatabasePartitionTemplate', 'TokenPermission', + 'GetDatabasePartitionTemplateResult', 'GetDatabasesDatabaseResult', + 'GetDatabasesDatabasePartitionTemplateResult', 'GetTokenPermissionResult', 'GetTokensTokenResult', 'GetTokensTokenPermissionResult', ] +@pulumi.output_type +class DatabasePartitionTemplate(dict): + def __init__(__self__, *, + type: str, + value: str): + """ + :param str type: The type of template part. Valid values are `bucket`, `tag` or `time`. + :param str value: The value of template part. **Note:** For `bucket` partition template type use `jsonencode()` function to encode the value to a string. + """ + pulumi.set(__self__, "type", type) + pulumi.set(__self__, "value", value) + + @property + @pulumi.getter + def type(self) -> str: + """ + The type of template part. Valid values are `bucket`, `tag` or `time`. + """ + return pulumi.get(self, "type") + + @property + @pulumi.getter + def value(self) -> str: + """ + The value of template part. **Note:** For `bucket` partition template type use `jsonencode()` function to encode the value to a string. + """ + return pulumi.get(self, "value") + + @pulumi.output_type class TokenPermission(dict): def __init__(__self__, *, @@ -47,6 +79,35 @@ def resource(self) -> str: return pulumi.get(self, "resource") +@pulumi.output_type +class GetDatabasePartitionTemplateResult(dict): + def __init__(__self__, *, + type: str, + value: str): + """ + :param str type: The type of template part. + :param str value: The value of template part. + """ + pulumi.set(__self__, "type", type) + pulumi.set(__self__, "value", value) + + @property + @pulumi.getter + def type(self) -> str: + """ + The type of template part. + """ + return pulumi.get(self, "type") + + @property + @pulumi.getter + def value(self) -> str: + """ + The value of template part. + """ + return pulumi.get(self, "value") + + @pulumi.output_type class GetDatabasesDatabaseResult(dict): def __init__(__self__, *, @@ -55,6 +116,7 @@ def __init__(__self__, *, max_columns_per_table: int, max_tables: int, name: str, + partition_templates: Sequence['outputs.GetDatabasesDatabasePartitionTemplateResult'], retention_period: int): """ :param str account_id: The ID of the account that the cluster belongs to. @@ -62,6 +124,7 @@ def __init__(__self__, *, :param int max_columns_per_table: The maximum number of columns per table for the cluster database. :param int max_tables: The maximum number of tables for the cluster database. :param str name: The name of the cluster database. + :param Sequence['GetDatabasesDatabasePartitionTemplateArgs'] partition_templates: The template partitioning of the cluster database. :param int retention_period: The retention period of the cluster database in nanoseconds. """ pulumi.set(__self__, "account_id", account_id) @@ -69,6 +132,7 @@ def __init__(__self__, *, pulumi.set(__self__, "max_columns_per_table", max_columns_per_table) pulumi.set(__self__, "max_tables", max_tables) pulumi.set(__self__, "name", name) + pulumi.set(__self__, "partition_templates", partition_templates) pulumi.set(__self__, "retention_period", retention_period) @property @@ -111,6 +175,14 @@ def name(self) -> str: """ return pulumi.get(self, "name") + @property + @pulumi.getter(name="partitionTemplates") + def partition_templates(self) -> Sequence['outputs.GetDatabasesDatabasePartitionTemplateResult']: + """ + The template partitioning of the cluster database. + """ + return pulumi.get(self, "partition_templates") + @property @pulumi.getter(name="retentionPeriod") def retention_period(self) -> int: @@ -120,6 +192,35 @@ def retention_period(self) -> int: return pulumi.get(self, "retention_period") +@pulumi.output_type +class GetDatabasesDatabasePartitionTemplateResult(dict): + def __init__(__self__, *, + type: str, + value: str): + """ + :param str type: The type of template part. + :param str value: The value of template part. + """ + pulumi.set(__self__, "type", type) + pulumi.set(__self__, "value", value) + + @property + @pulumi.getter + def type(self) -> str: + """ + The type of template part. + """ + return pulumi.get(self, "type") + + @property + @pulumi.getter + def value(self) -> str: + """ + The value of template part. + """ + return pulumi.get(self, "value") + + @pulumi.output_type class GetTokenPermissionResult(dict): def __init__(__self__, *,