Skip to content

Deprecated parameters are required for container v1 projects.zones.operations.get #2086

Open
@jatinkatyal13

Description

@jatinkatyal13

Environment details

  • OS: MacOS 12.5
  • Python version: 3.9.16
  • pip version: 22.0.4
  • google-api-python-client version: 2.79.0

Steps to reproduce

  1. Run the following code to get operation
def get_operation_progress():
  response = client.projects().zones().operations().get(
      name="projects/<projectId>/locations/<locationId>/operations/<operationId>"
  ).execute()

  print(json.dumps(response))

It throws the following error

TypeError: Missing required parameter "operationId"
  1. When trying to run the code with deprecated parameters the following API error is thrown
def get_operation_progress():
  response = client.projects().zones().operations().get(
      projectId="<project>",
      zone="<zone>",
      operationId="<operation>",
  ).execute()

  print(json.dumps(response))
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://container.googleapis.com/v1/projects/<project>/zones/<location>/operations/<operation>?alt=json returned "'zone' field cannot be used to access GKE regional clusters. Use 'name' field instead.". Details: "'zone' field cannot be used to access GKE regional clusters. Use 'name' field instead.">

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions