Skip to content

Commit 7a8d684

Browse files
authored
go rewrite workbench-storageinsights (#11270)
1 parent 43bed5c commit 7a8d684

31 files changed

+3874
-103
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
# Copyright 2024 Google Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
# Warning: This is a temporary file, and should not be edited directly
15+
---
16+
name: 'ReportConfig'
17+
description: |
18+
Represents an inventory report configuration.
19+
references:
20+
guides:
21+
'Official Documentation': 'https://cloud.google.com/storage/docs/insights/using-storage-insights'
22+
api: 'https://cloud.google.com/storage/docs/json_api/v1/reportConfig'
23+
docs:
24+
base_url: 'projects/{{project}}/locations/{{location}}/reportConfigs'
25+
self_link: 'projects/{{project}}/locations/{{location}}/reportConfigs/{{name}}'
26+
create_url: 'projects/{{project}}/locations/{{location}}/reportConfigs'
27+
update_verb: 'PATCH'
28+
update_mask: true
29+
timeouts:
30+
insert_minutes: 20
31+
update_minutes: 20
32+
delete_minutes: 20
33+
custom_code:
34+
examples:
35+
- name: 'storage_insights_report_config'
36+
primary_resource_id: 'config'
37+
vars:
38+
bucket_name: 'my-bucket'
39+
parameters:
40+
- name: 'location'
41+
type: String
42+
description: |
43+
The location of the ReportConfig. The source and destination buckets specified in the ReportConfig
44+
must be in the same location.
45+
url_param_only: true
46+
required: true
47+
immutable: true
48+
properties:
49+
- name: 'name'
50+
type: String
51+
description: |
52+
The UUID of the inventory report configuration.
53+
output: true
54+
custom_flatten: 'templates/terraform/custom_flatten/go/name_from_self_link.tmpl'
55+
- name: 'frequencyOptions'
56+
type: NestedObject
57+
description: |
58+
Options for configuring how inventory reports are generated.
59+
properties:
60+
- name: 'frequency'
61+
type: Enum
62+
description: |
63+
The frequency in which inventory reports are generated. Values are DAILY or WEEKLY.
64+
required: true
65+
enum_values:
66+
- 'DAILY'
67+
- 'WEEKLY'
68+
- name: 'startDate'
69+
type: NestedObject
70+
description: |
71+
The date to start generating inventory reports. For example, {"day": 15, "month": 8, "year": 2022}.
72+
required: true
73+
properties:
74+
- name: 'day'
75+
type: Integer
76+
description: 'The day of the month to start generating inventory reports.'
77+
required: true
78+
- name: 'month'
79+
type: Integer
80+
description: 'The month to start generating inventory reports.'
81+
required: true
82+
- name: 'year'
83+
type: Integer
84+
description: 'The year to start generating inventory reports'
85+
required: true
86+
- name: 'endDate'
87+
type: NestedObject
88+
description: |
89+
The date to stop generating inventory reports. For example, {"day": 15, "month": 9, "year": 2022}.
90+
required: true
91+
properties:
92+
- name: 'day'
93+
type: Integer
94+
description: 'The day of the month to stop generating inventory reports.'
95+
required: true
96+
- name: 'month'
97+
type: Integer
98+
description: 'The month to stop generating inventory reports.'
99+
required: true
100+
- name: 'year'
101+
type: Integer
102+
description: 'The year to stop generating inventory reports'
103+
required: true
104+
- name: 'csvOptions'
105+
type: NestedObject
106+
description: |
107+
Options for configuring the format of the inventory report CSV file.
108+
required: true
109+
properties:
110+
- name: 'recordSeparator'
111+
type: String
112+
description: |
113+
The character used to separate the records in the inventory report CSV file.
114+
- name: 'delimiter'
115+
type: String
116+
description: |
117+
The delimiter used to separate the fields in the inventory report CSV file.
118+
- name: 'headerRequired'
119+
type: Boolean
120+
description: |
121+
The boolean that indicates whether or not headers are included in the inventory report CSV file.
122+
- name: 'objectMetadataReportOptions'
123+
type: NestedObject
124+
description: |
125+
Options for including metadata in an inventory report.
126+
update_mask_fields:
127+
- 'objectMetadataReportOptions.metadataFields'
128+
- 'objectMetadataReportOptions.storageDestinationOptions.bucket'
129+
- 'objectMetadataReportOptions.storageDestinationOptions.destinationPath'
130+
properties:
131+
- name: 'metadataFields'
132+
type: Array
133+
description: |
134+
The metadata fields included in an inventory report.
135+
required: true
136+
item_type:
137+
type: String
138+
- name: 'storageFilters'
139+
type: NestedObject
140+
properties:
141+
- name: 'bucket'
142+
type: String
143+
description: |
144+
The filter to use when specifying which bucket to generate inventory reports for.
145+
immutable: true
146+
- name: 'storageDestinationOptions'
147+
type: NestedObject
148+
description: |
149+
Options for where the inventory reports are stored.
150+
required: true
151+
properties:
152+
- name: 'bucket'
153+
type: String
154+
description: |
155+
The destination bucket that stores the generated inventory reports.
156+
required: true
157+
- name: 'destinationPath'
158+
type: String
159+
description: |
160+
The path within the destination bucket to store generated inventory reports.
161+
- name: 'displayName'
162+
type: String
163+
description: |
164+
The editable display name of the inventory report configuration. Has a limit of 256 characters. Can be empty.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2024 Google Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
# Warning: This is a temporary file, and should not be edited directly
15+
---
16+
name: 'StorageInsights'
17+
display_name: 'Cloud Storage Insights'
18+
versions:
19+
- name: 'ga'
20+
base_url: 'https://storageinsights.googleapis.com/v1/'
21+
scopes:
22+
- 'https://www.googleapis.com/auth/devstorage.full_control'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Copyright 2024 Google Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
# Warning: This is a temporary file, and should not be edited directly
15+
---
16+
name: 'AgentPool'
17+
description: 'Represents an On-Premises Agent pool.'
18+
references:
19+
guides:
20+
'Official Documentation': 'https://cloud.google.com/storage-transfer/docs/on-prem-agent-pools'
21+
api: 'https://cloud.google.com/storage-transfer/docs/reference/rest/v1/projects.agentPools'
22+
docs:
23+
base_url: 'projects/{{project}}/agentPools'
24+
self_link: 'projects/{{project}}/agentPools/{{name}}'
25+
create_url: 'projects/{{project}}/agentPools?agentPoolId={{name}}'
26+
update_verb: 'PATCH'
27+
update_mask: true
28+
timeouts:
29+
insert_minutes: 30
30+
update_minutes: 20
31+
delete_minutes: 20
32+
custom_code:
33+
constants: 'templates/terraform/constants/go/agent_pool.go.tmpl'
34+
post_create: 'templates/terraform/post_create/go/agent_pool.go.tmpl'
35+
pre_update: 'templates/terraform/pre_update/go/agent_pool.go.tmpl'
36+
post_import: 'templates/terraform/post_import/go/agent_pool.go.tmpl'
37+
examples:
38+
- name: 'agent_pool_basic'
39+
primary_resource_id: 'example'
40+
vars:
41+
agent-pool-name: 'agent-pool-example'
42+
test_env_vars:
43+
project_id: 'PROJECT_NAME'
44+
skip_test: true
45+
parameters:
46+
properties:
47+
- name: 'name'
48+
type: String
49+
description: |
50+
The ID of the agent pool to create.
51+
52+
The agentPoolId must meet the following requirements:
53+
* Length of 128 characters or less.
54+
* Not start with the string goog.
55+
* Start with a lowercase ASCII character, followed by:
56+
* Zero or more: lowercase Latin alphabet characters, numerals, hyphens (-), periods (.), underscores (_), or tildes (~).
57+
* One or more numerals or lowercase ASCII characters.
58+
59+
As expressed by the regular expression: ^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$.
60+
url_param_only: true
61+
required: true
62+
immutable: true
63+
- name: 'displayName'
64+
type: String
65+
description: 'Specifies the client-specified AgentPool description.'
66+
- name: 'state'
67+
type: Enum
68+
description: 'Specifies the state of the AgentPool.'
69+
output: true
70+
enum_values:
71+
- 'CREATING'
72+
- 'CREATED'
73+
- 'DELETING'
74+
- name: 'bandwidthLimit'
75+
type: NestedObject
76+
description: |
77+
Specifies the bandwidth limit details. If this field is unspecified, the default value is set as 'No Limit'.
78+
properties:
79+
- name: 'limitMbps'
80+
type: String
81+
description:
82+
'Bandwidth rate in megabytes per second, distributed across all the
83+
agents in the pool.'
84+
required: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2024 Google Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
# Warning: This is a temporary file, and should not be edited directly
15+
---
16+
name: 'StorageTransfer'
17+
display_name: 'Storage Transfer Service'
18+
versions:
19+
- name: 'ga'
20+
base_url: 'https://storagetransfer.googleapis.com/v1/'
21+
scopes:
22+
- 'https://www.googleapis.com/auth/cloud-platform'

mmv1/products/tags/go_TagBinding.yaml

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Copyright 2024 Google Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
# Warning: This is a temporary file, and should not be edited directly
15+
---
16+
name: 'TagBinding'
17+
description:
18+
A TagBinding represents a connection between a TagValue and a cloud resource
19+
(currently project, folder, or organization). Once a TagBinding is created,
20+
the TagValue is applied to all the descendants of the cloud resource.
21+
references:
22+
guides:
23+
'Official Documentation': 'https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing'
24+
api: 'https://cloud.google.com/resource-manager/reference/rest/v3/tagBindings'
25+
docs:
26+
id_format: 'tagBindings/{{name}}'
27+
base_url: 'tagBindings'
28+
self_link: 'tagBindings/?parent={{parent}}&pageSize=300'
29+
delete_url: 'tagBindings/{{name}}'
30+
immutable: true
31+
mutex: 'tagBindings/{{parent}}'
32+
import_format:
33+
- 'tagBindings/{{name}}'
34+
- '{{name}}'
35+
timeouts:
36+
insert_minutes: 20
37+
update_minutes: 20
38+
delete_minutes: 20
39+
autogen_async: true
40+
async:
41+
actions: ['create', 'delete', 'update']
42+
type: 'OpAsync'
43+
operation:
44+
base_url: '{{op_id}}'
45+
path: 'name'
46+
wait_ms: 1000
47+
result:
48+
path: 'response'
49+
resource_inside_response: true
50+
error:
51+
path: 'error'
52+
message: 'message'
53+
nested_query:
54+
keys:
55+
- tagBindings
56+
is_list_of_ids: false
57+
modify_by_patch: false
58+
custom_code:
59+
custom_import: 'templates/terraform/custom_import/go/tags_tag_binding.go.tmpl'
60+
examples:
61+
- name: 'tag_binding_basic'
62+
primary_resource_id: 'binding'
63+
vars:
64+
key_short_name: 'keyname'
65+
value_short_name: 'valuename'
66+
project_id: 'project_id'
67+
test_env_vars:
68+
org_id: 'ORG_ID'
69+
test_vars_overrides:
70+
'key_short_name': '"tf-test-key-" + acctest.RandString(t, 10)'
71+
'value_short_name': '"tf-test-value-" + acctest.RandString(t, 10)'
72+
'project_id': '"tf-test-" + acctest.RandString(t, 10)'
73+
skip_test: true
74+
parameters:
75+
properties:
76+
- name: 'name'
77+
type: String
78+
description: |
79+
The generated id for the TagBinding. This is a string of the form: `tagBindings/{full-resource-name}/{tag-value-name}`
80+
output: true
81+
custom_flatten: 'templates/terraform/custom_flatten/go/tags_tag_binding_name.tmpl'
82+
- name: 'parent'
83+
type: String
84+
description: |
85+
The full resource name of the resource the TagValue is bound to. E.g. //cloudresourcemanager.googleapis.com/projects/123
86+
required: true
87+
- name: 'tagValue'
88+
type: String
89+
description: |
90+
The TagValue of the TagBinding. Must be of the form tagValues/456.
91+
required: true

0 commit comments

Comments
 (0)