Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
  • Loading branch information
2 people authored and Jerry Ding committed Oct 31, 2024
1 parent 72dd68f commit 43f3591
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 58 deletions.
129 changes: 77 additions & 52 deletions mmv1/products/dataprocgdc/ServiceInstance.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,64 @@
# Copyright 2024 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
name: ServiceInstance
description: A service instance is an instance of the Dataproc operator running on a GDC cluster.
references:
guides:
'Dataproc Intro': 'https://cloud.google.com/dataproc/'
api: 'https://cloud.google.com/dataproc-gdc/docs/reference/rest/v1/projects.locations.serviceInstances'
base_url: projects/{{project}}/locations/{{location}}/serviceInstances
create_url: projects/{{project}}/locations/{{location}}/serviceInstances?serviceInstanceId={{service_instance_id}}
self_link: projects/{{project}}/locations/{{location}}/serviceInstances/{{service_instance_id}}
id_format: projects/{{project}}/locations/{{location}}/serviceInstances/{{service_instance_id}}
import_format:
- projects/{{project}}/locations/{{location}}/serviceInstances/{{service_instance_id}}
name: ServiceInstance
description: A service instance is an instance of the Dataproc operator running on a GDC cluster.
autogen_async: true
parameters:
- name: location
type: String
description: 'Location of the resource. '
url_param_only: true
required: true
immutable: true
- name: serviceInstanceId
type: String
description: "Id of the service instance."
url_param_only: true
required: true
immutable: true
async:
actions: ['create', 'delete']
type: OpAsync
operation:
base_url: "{{op_id}}"
immutable: true
examples:
- name: "dataprocgdc_serviceinstance"
primary_resource_id: "service-instance"
vars:
service_instance_id: "tf-e2e-service-instance"
project: "my-project"
test_vars_overrides:
'project': '"gdce-cluster-monitoring"'
properties:
- name: gdceCluster
type: NestedObject
properties:
- name: gdceCluster
type: String
description: 'Required. Gdce cluster resource id. '
description: 'Gdce cluster resource id. '
required: true
description: 'Gdce cluster information. '
- name: name
Expand All @@ -23,7 +68,7 @@ properties:
- name: uid
type: String
description: "System generated unique identifier for this service instance,
formatted as\nUUID4. "
formatted as UUID4. "
output: true
- name: displayName
type: String
Expand All @@ -38,31 +83,42 @@ properties:
output: true
- name: requestedState
type: String
description: "The intended state to which the service instance is reconciling.
\n Possible values:\n STATE_UNSPECIFIED\nCREATING\nACTIVE\nDISCONNECTED\nDELETING\nSTOPPING\nSTOPPED\nSTARTING\nUPDATING\nFAILED"
description: |
The intended state to which the service instance is reconciling. Possible values:
* `CREATING`
* `ACTIVE`
* `DISCONNECTED`
* `DELETING`
* `STOPPING`
* `STOPPED`
* `STARTING`
* `UPDATING`
* `FAILED`
output: true
- name: state
type: String
description: "The current state. \n Possible values:\n STATE_UNSPECIFIED\nCREATING\nACTIVE\nDISCONNECTED\nDELETING\nSTOPPING\nSTOPPED\nSTARTING\nUPDATING\nFAILED"
description: |
The current state. Possible values:
* `CREATING`
* `ACTIVE`
* `DISCONNECTED`
* `DELETING`
* `STOPPING`
* `STOPPED`
* `STARTING`
* `UPDATING`
* `FAILED`
output: true
- name: reconciling
type: Boolean
description: "Whether the service instance is currently reconciling.\nTrue
if the current state of the resource does not match the\nintended state, and the
system is working to reconcile them, whether\nor not the change was user initiated.\nRequired
by aip.dev/128#reconciliation "
description: "Whether the service instance is currently reconciling. True
if the current state of the resource does not match the intended state, and the
system is working to reconcile them, whether or not the change was user initiated."
output: true
- name: labels
type: KeyValueLabels
output:
api_name:
description: "The labels to associate with this service instance. Labels
may be used for\nfiltering and billing tracking. "
min_version:
ignore_write:
update_verb:
update_url:
immutable:
may be used for filtering and billing tracking. "
- name: sparkServiceInstanceConfig
type: NestedObject
properties: []
Expand All @@ -77,38 +133,7 @@ properties:
- name: effectiveServiceAccount
type: String
description: "Effective service account associated with ServiceInstance.
This will be\nthe service_account if specified. Otherwise, it will be an automatically\ncreated
per-resource P4SA that also automatically has Fleet Workload\nIdentity bindings
This will be the service_account if specified. Otherwise, it will be an automatically created
per-resource P4SA that also automatically has Fleet Workload. Identity bindings
applied. "
output: true
parameters:
- name: location
type: String
description: 'Resource ID segment making up resource `name`. It identifies the resource
within its parent collection as described in https://google.aip.dev/122. See documentation
for resource type `dataprocgdc.googleapis.com/SparkApplication`. '
url_param_only: true
required: true
immutable: true
- name: serviceInstanceId
type: String
description: "Required. Id of the requesting object\nIf auto-generating Id server-side,
remove this field and\nservice_instance_id from the method_signature of Create
RPC "
url_param_only: true
required: true
immutable: true
async:
actions: ['create', 'delete']
type: OpAsync
operation:
base_url: "{{op_id}}"
immutable: true
examples:
- name: "dataprocgdc_serviceinstance"
primary_resource_id: "service-instance"
vars:
service_instance_id: "tf-e2e-service-instance"
project: "my-project"
test_vars_overrides:
'project': '"gdce-cluster-monitoring"'
22 changes: 17 additions & 5 deletions mmv1/products/dataprocgdc/product.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
--- !ruby/object:Api::Product
versions:
- !ruby/object:Api::Product::Version
base_url: https://dataprocgdc.googleapis.com/v1/
name: ga
# Copyright 2024 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
name: DataprocGdc
display_name: Dataproc on GDC
versions:
- name: ga
base_url: https://dataprocgdc.googleapis.com/v1/
scopes:
- https://www.googleapis.com/auth/cloud-platform
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resource "google_dataproc_gdc_service_instance" "{{$.PrimaryResourceId}}" {
gdce_cluster {
gdce_cluster = "projects/gdce-cluster-monitoring/locations/us-west2/clusters/gdce-prism-prober-ord106"
}
display_name = "A service instance for a Terraform create test"
display_name = "A service instance"
labels = {
"test-label": "label-value"
}
Expand Down

0 comments on commit 43f3591

Please sign in to comment.