Documentation
¶
Index ¶
Constants ¶
View Source
const ( HeaderWorkspace = "workspace" HeaderContentType = "Content-Type" ApplicationJson = "application/json" )
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(client *golangsdk.ServiceClient, resourceId, workspace string) error
Delete is used to delete a resource. Send request DELETE /v1/{project_id}/resources/{resource_id}
Types ¶
type CreateResp ¶
type CreateResp struct {
ResourceId string `json:"resourceId"`
}
func Create ¶
func Create(client *golangsdk.ServiceClient, opts Resource) (*CreateResp, error)
Create is used to create a resource. Types of nodes, including DLI Spark, MRS Spark, and MRS MapReduce, can reference files such as JAR and properties through resources. Send request POST /v1/{project_id}/resources
type DependPackage ¶
type ListResp ¶
type ListResp struct {
// Total is the total number of resources.
Total int `json:"total"`
// Resources is a list of resources.
Resources []*Resource `json:"resources"`
}
type Resource ¶
type Resource struct {
// Workspace ID.
Workspace string `json:"-"`
// Name is a name of the resource. The name contains a maximum of 32 characters, including only letters, numbers, underscores (_), and hyphens (-).
Name string `json:"name" required:"true"`
// Type is a resource type. Can be: archive, file, jar
Type string `json:"type" required:"true"`
// Location is an OBS path for storing the resource file. When type is set to jar, location is the path for storing the main JAR package. The path contains a maximum of 1,023 characters. For example, obs://myBucket/test.jar
Location string `json:"location" required:"true"`
// JAR package and properties file that the main JAR package depends on. The description contains a maximum of 10,240 characters. If this parameter and the dependFiles parameter are both available, this parameter is preferentially parsed.
DependPackages []*DependPackage `json:"dependPackages,omitempty"`
// DependFiles is a JAR package and properties file that the main JAR package depends on. The description contains a maximum of 10,240 characters.
DependFiles []string `json:"dependFiles,omitempty"`
// Description of the resource. The description contains a maximum of 255 characters.
Desc string `json:"desc,omitempty"`
// Directory for storing the resource. Access the DataArts Studio console and choose Data Development. The default directory is the root directory.
Directory string `json:"directory,omitempty"`
}
func Get ¶
func Get(client *golangsdk.ServiceClient, resourceId, workspace string) (*Resource, error)
Get is used to query resource details. A resource contains various files such as JAR, ZIP, and properties files. A created resource can be used in job nodes such as DLI Spark and MRS Spark. Send request GET /v1/{project_id}/resources/{resource_id}
Click to show internal directories.
Click to hide internal directories.