Skip to content

Commit

Permalink
Container: pick up fixes to GAPIC generator. (#6634)
Browse files Browse the repository at this point in the history
Includes fixes from these PRs:

- googleapis/gapic-generator#2407
- googleapis/gapic-generator#2396

Includes changes to generated tests.

Includes synth replacements to work around generated docstring issue:

- googleapis/gapic-generator/issues/2449

Closes #6483.
  • Loading branch information
tseaver committed Nov 21, 2018
1 parent 1e79622 commit 57dafcb
Show file tree
Hide file tree
Showing 8 changed files with 2,124 additions and 732 deletions.
571 changes: 409 additions & 162 deletions container/google/cloud/container_v1/gapic/cluster_manager_client.py

Large diffs are not rendered by default.

Expand Up @@ -18,152 +18,152 @@
},
"methods": {
"ListClusters": {
"timeout_millis": 10000,
"timeout_millis": 20000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"GetCluster": {
"timeout_millis": 10000,
"timeout_millis": 20000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"CreateCluster": {
"timeout_millis": 60000,
"timeout_millis": 45000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"UpdateCluster": {
"timeout_millis": 60000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"UpdateNodePool": {
"timeout_millis": 60000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"SetNodePoolAutoscaling": {
"timeout_millis": 60000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"SetLoggingService": {
"timeout_millis": 60000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"SetMonitoringService": {
"timeout_millis": 60000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"SetAddonsConfig": {
"timeout_millis": 60000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"SetLocations": {
"timeout_millis": 60000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"UpdateMaster": {
"timeout_millis": 60000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"SetMasterAuth": {
"timeout_millis": 60000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"DeleteCluster": {
"timeout_millis": 30000,
"timeout_millis": 20000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"ListOperations": {
"timeout_millis": 10000,
"timeout_millis": 20000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"GetOperation": {
"timeout_millis": 10000,
"timeout_millis": 20000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"CancelOperation": {
"timeout_millis": 30000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"GetServerConfig": {
"timeout_millis": 10000,
"timeout_millis": 20000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"ListNodePools": {
"timeout_millis": 10000,
"timeout_millis": 20000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"GetNodePool": {
"timeout_millis": 10000,
"timeout_millis": 20000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"CreateNodePool": {
"timeout_millis": 60000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"DeleteNodePool": {
"timeout_millis": 30000,
"timeout_millis": 20000,
"retry_codes_name": "idempotent",
"retry_params_name": "default"
},
"RollbackNodePoolUpgrade": {
"timeout_millis": 60000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"SetNodePoolManagement": {
"timeout_millis": 60000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"SetLabels": {
"timeout_millis": 60000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"SetLegacyAbac": {
"timeout_millis": 60000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"StartIPRotation": {
"timeout_millis": 60000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"CompleteIPRotation": {
"timeout_millis": 60000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"SetNodePoolSize": {
"timeout_millis": 60000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"SetNetworkPolicy": {
"timeout_millis": 60000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
},
"SetMaintenancePolicy": {
"timeout_millis": 60000,
"timeout_millis": 20000,
"retry_codes_name": "non_idempotent",
"retry_params_name": "default"
}
Expand Down
3 changes: 3 additions & 0 deletions container/google/cloud/container_v1/gapic/enums.py
Expand Up @@ -47,13 +47,16 @@ class Status(enum.IntEnum):
STOPPING (int): The STOPPING state indicates the cluster is being deleted.
ERROR (int): The ERROR state indicates the cluster may be unusable. Details can be
found in the ``statusMessage`` field.
DEGRADED (int): The DEGRADED state indicates the cluster requires user action to restore
full functionality. Details can be found in the ``statusMessage`` field.
"""
STATUS_UNSPECIFIED = 0
PROVISIONING = 1
RUNNING = 2
RECONCILING = 3
STOPPING = 4
ERROR = 5
DEGRADED = 6


class Operation(object):
Expand Down
Expand Up @@ -62,6 +62,8 @@ def __init__(self,
credentials=credentials,
)

self._channel = channel

# gRPC uses objects called "stubs" that are bound to the
# channel and provide a basic method for each RPC.
self._stubs = {
Expand Down Expand Up @@ -92,6 +94,15 @@ def create_channel(cls,
scopes=cls._OAUTH_SCOPES,
)

@property
def channel(self):
"""The gRPC channel used by the transport.
Returns:
grpc.Channel: A gRPC channel object.
"""
return self._channel

@property
def list_clusters(self):
"""Return the gRPC stub for {$apiMethod.name}.
Expand Down Expand Up @@ -160,7 +171,7 @@ def update_cluster(self):
def update_node_pool(self):
"""Return the gRPC stub for {$apiMethod.name}.
Updates the version and/or image type of a specific node pool.
Updates the version and/or image type for a specific node pool.
Returns:
Callable: A callable which accepts the appropriate
Expand All @@ -173,7 +184,7 @@ def update_node_pool(self):
def set_node_pool_autoscaling(self):
"""Return the gRPC stub for {$apiMethod.name}.
Sets the autoscaling settings of a specific node pool.
Sets the autoscaling settings for a specific node pool.
Returns:
Callable: A callable which accepts the appropriate
Expand All @@ -186,7 +197,7 @@ def set_node_pool_autoscaling(self):
def set_logging_service(self):
"""Return the gRPC stub for {$apiMethod.name}.
Sets the logging service of a specific cluster.
Sets the logging service for a specific cluster.
Returns:
Callable: A callable which accepts the appropriate
Expand All @@ -199,7 +210,7 @@ def set_logging_service(self):
def set_monitoring_service(self):
"""Return the gRPC stub for {$apiMethod.name}.
Sets the monitoring service of a specific cluster.
Sets the monitoring service for a specific cluster.
Returns:
Callable: A callable which accepts the appropriate
Expand All @@ -212,7 +223,7 @@ def set_monitoring_service(self):
def set_addons_config(self):
"""Return the gRPC stub for {$apiMethod.name}.
Sets the addons of a specific cluster.
Sets the addons for a specific cluster.
Returns:
Callable: A callable which accepts the appropriate
Expand All @@ -225,7 +236,7 @@ def set_addons_config(self):
def set_locations(self):
"""Return the gRPC stub for {$apiMethod.name}.
Sets the locations of a specific cluster.
Sets the locations for a specific cluster.
Returns:
Callable: A callable which accepts the appropriate
Expand All @@ -238,7 +249,7 @@ def set_locations(self):
def update_master(self):
"""Return the gRPC stub for {$apiMethod.name}.
Updates the master of a specific cluster.
Updates the master for a specific cluster.
Returns:
Callable: A callable which accepts the appropriate
Expand All @@ -252,7 +263,7 @@ def set_master_auth(self):
"""Return the gRPC stub for {$apiMethod.name}.
Used to set master auth materials. Currently supports :-
Changing the admin password of a specific cluster.
Changing the admin password for a specific cluster.
This can be either via password generation or explicitly set the password.
Returns:
Expand Down Expand Up @@ -326,7 +337,7 @@ def cancel_operation(self):
def get_server_config(self):
"""Return the gRPC stub for {$apiMethod.name}.
Returns configuration info about the Container Engine service.
Returns configuration info about the Kubernetes Engine service.
Returns:
Callable: A callable which accepts the appropriate
Expand Down Expand Up @@ -470,7 +481,7 @@ def complete_i_p_rotation(self):
def set_node_pool_size(self):
"""Return the gRPC stub for {$apiMethod.name}.
Sets the size of a specific node pool.
Sets the size for a specific node pool.
Returns:
Callable: A callable which accepts the appropriate
Expand Down
1,796 changes: 1,341 additions & 455 deletions container/google/cloud/container_v1/proto/cluster_service_pb2.py

Large diffs are not rendered by default.

0 comments on commit 57dafcb

Please sign in to comment.