All Products
Search
Document Center

MaxCompute:GetPackage

Last Updated:Oct 24, 2024

Obtains the information about a package.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
odps:GetPackageget
  • Project
    acs:odps:{#regionId}:{#accountId}:projects/{#ProjectName}
    none
none

Request syntax

GET /api/v1/projects/{projectName}/packages/{packageName} HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
projectNamestringYes

The name of the MaxCompute project.

projectA
packageNamestringYes

The name of the package.

test_package
sourceProjectstringNo

The project to which the package belongs. This parameter is required if the package is installed in the MaxCompute project.

projectB

Response parameters

ParameterTypeDescriptionExample
object

PopResult

requestIdstring

The ID of the request.

0b57ff8316614119858417939e3e54
httpCodeinteger

Indicates whether the request was successful. If this parameter was not empty and the value of this parameter was not 200, the request failed.

200
errorCodestring

The error code returned if the request failed.

040002
errorMsgstring

The error message.

error message.
dataobject

The returned data.

allowedProjectListarray<object>

The projects in which the package is installed.

allowedProjectListobject

The projects in which the package is installed.

labelstring

The security level for sensitive data.

2
projectstring

The name of the MaxCompute project.

proejctB
resourceListobject

The details of the resources that are included in the package.

tablearray<object>

The tables.

tableobject

The tables.

namestring

The name of the table.

dim_odps
schemaNamestring

The name of schema.

default
actionsarray

The operations that were performed on the table.

actionstring

The operations that were performed on the table.

describe
resourcearray<object>

The resources.

resourceobject

The resources.

namestring

The name of the resource.

res_1
schemaNamestring

The name of schema.

default
actionsarray

The operations that were performed on the resource.

actionstring

The operations that were performed on the resource.

read
functionarray<object>

The functions.

functionobject

The functions.

namestring

The name of the function.

function_1
schemaNamestring

The name of schema.

default
actionsarray

The operations that were performed on the function.

actionstring

The operations that were performed on the function.

read

Examples

Sample success responses

JSONformat

{
  "requestId": "0b57ff8316614119858417939e3e54",
  "httpCode": 200,
  "errorCode": "040002",
  "errorMsg": "error message.",
  "data": {
    "allowedProjectList": [
      {
        "label": "2",
        "project": "proejctB"
      }
    ],
    "resourceList": {
      "table": [
        {
          "name": "dim_odps\n",
          "schemaName": "default",
          "actions": [
            "describe"
          ]
        }
      ],
      "resource": [
        {
          "name": "res_1",
          "schemaName": "default",
          "actions": [
            "read"
          ]
        }
      ],
      "function": [
        {
          "name": "function_1",
          "schemaName": "default",
          "actions": [
            "read"
          ]
        }
      ]
    }
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-12-10The response structure of the API has changedView Change Details