# Apigee API . organizations . environments . apis . revisions . debugsessions

## Instance Methods

Returns the data Resource.

Close httplib2 connections.

Creates a debug session for a deployed API Proxy revision.

Deletes the data from a debug session. This does not cancel the debug session or prevent further data from being collected if the session is still active in runtime pods.

Retrieves a debug session.

Lists debug sessions that are currently active in the given API Proxy revision.

Retrieves the next page of results.

### Method Details

`close()`

    Close httplib2 connections.

`create(parent, body=None, timeout=None, x__xgafv=None)`

    Creates a debug session for a deployed API Proxy revision.

    Args:
      parent: string, Required. The resource name of the API Proxy revision deployment for which to create the DebugSession. Must be of the form `organizations/{organization}/environments/{environment}/apis/{api}/revisions/{revision}`. (required)
      body: object, The request body.
        The object takes the form of:

    {
      "count": 42, # Optional. The number of request to be traced. Min = 1, Max = 15, Default = 10.
      "createTime": "A String", # Output only. The first transaction creation timestamp, recorded by UAP.
      "filter": "A String", # Optional. A conditional statement which is evaluated against the request message to determine if it should be traced. Syntax matches that of on API Proxy bundle flow Condition.
      "name": "A String", # A unique ID for this DebugSession.
      "timeout": "A String", # Optional. The time in seconds after which this DebugSession should end. This value will override the value in query param, if both are provided.
      "tracesize": 42, # Optional. The maximum number of bytes captured from the response payload. Min = 0, Max = 5120, Default = 5120.
      "validity": 42, # Optional. The length of time, in seconds, that this debug session is valid, starting from when it's received in the control plane. Min = 1, Max = 15, Default = 10.
    }

      timeout: string, Optional. The time in seconds after which this DebugSession should end. A timeout specified in DebugSession will overwrite this value.
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        {
      "count": 42, # Optional. The number of request to be traced. Min = 1, Max = 15, Default = 10.
      "createTime": "A String", # Output only. The first transaction creation timestamp, recorded by UAP.
      "filter": "A String", # Optional. A conditional statement which is evaluated against the request message to determine if it should be traced. Syntax matches that of on API Proxy bundle flow Condition.
      "name": "A String", # A unique ID for this DebugSession.
      "timeout": "A String", # Optional. The time in seconds after which this DebugSession should end. This value will override the value in query param, if both are provided.
      "tracesize": 42, # Optional. The maximum number of bytes captured from the response payload. Min = 0, Max = 5120, Default = 5120.
      "validity": 42, # Optional. The length of time, in seconds, that this debug session is valid, starting from when it's received in the control plane. Min = 1, Max = 15, Default = 10.
    }

`deleteData(name, x__xgafv=None)`

    Deletes the data from a debug session. This does not cancel the debug session or prevent further data from being collected if the session is still active in runtime pods.

    Args:
      name: string, Required. The name of the debug session to delete. Must be of the form: `organizations/{organization}/environments/{environment}/apis/{api}/revisions/{revision}/debugsessions/{debugsession}`. (required)
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
    }

`get(name, x__xgafv=None)`

    Retrieves a debug session.

    Args:
      name: string, Required. The name of the debug session to retrieve. Must be of the form: `organizations/{organization}/environments/{environment}/apis/{api}/revisions/{revision}/debugsessions/{session}`. (required)
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        {
      "count": 42, # Optional. The number of request to be traced. Min = 1, Max = 15, Default = 10.
      "createTime": "A String", # Output only. The first transaction creation timestamp, recorded by UAP.
      "filter": "A String", # Optional. A conditional statement which is evaluated against the request message to determine if it should be traced. Syntax matches that of on API Proxy bundle flow Condition.
      "name": "A String", # A unique ID for this DebugSession.
      "timeout": "A String", # Optional. The time in seconds after which this DebugSession should end. This value will override the value in query param, if both are provided.
      "tracesize": 42, # Optional. The maximum number of bytes captured from the response payload. Min = 0, Max = 5120, Default = 5120.
      "validity": 42, # Optional. The length of time, in seconds, that this debug session is valid, starting from when it's received in the control plane. Min = 1, Max = 15, Default = 10.
    }

`list(parent, pageSize=None, pageToken=None, x__xgafv=None)`

    Lists debug sessions that are currently active in the given API Proxy revision.

    Args:
      parent: string, Required. The name of the API Proxy revision deployment for which to list debug sessions. Must be of the form: `organizations/{organization}/environments/{environment}/apis/{api}/revisions/{revision}`. (required)
      pageSize: integer, Maximum number of debug sessions to return. The page size defaults to 25.
      pageToken: string, Page token, returned from a previous ListDebugSessions call, that you can use to retrieve the next page.
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        {
      "nextPageToken": "A String", # Page token that you can include in a ListDebugSessionsRequest to retrieve the next page. If omitted, no subsequent pages exist.
      "sessions": [ # Session info that includes debug session ID and the first transaction creation timestamp.
        { # Session carries the debug session id and its creation time.
          "id": "A String", # The debug session ID.
          "timestampMs": "A String", # The first transaction creation timestamp in millisecond, recorded by UAP.
        },
      ],
    }

`list_next(previous_request, previous_response)`

    Retrieves the next page of results.

    Args:
      previous_request: The request for the previous page. (required)
      previous_response: The response from the request for the previous page. (required)

    Returns:
      A request object that you can call 'execute()' on to request the next
      page. Returns None if there are no more items in the collection.