Module: Aliyun::Odps

Defined in:
lib/aliyun/odps.rb,
lib/aliyun/odps/http.rb,
lib/aliyun/odps/list.rb,
lib/aliyun/odps/error.rb,
lib/aliyun/odps/utils.rb,
lib/aliyun/odps/client.rb,
lib/aliyun/odps/struct.rb,
lib/aliyun/odps/project.rb,
lib/aliyun/odps/version.rb,
lib/aliyun/odps/modelable.rb,
lib/aliyun/odps/model/table.rb,
lib/aliyun/odps/model/tables.rb,
lib/aliyun/odps/authorization.rb,
lib/aliyun/odps/configuration.rb,
lib/aliyun/odps/tunnel/router.rb,
lib/aliyun/odps/model/function.rb,
lib/aliyun/odps/model/instance.rb,
lib/aliyun/odps/model/projects.rb,
lib/aliyun/odps/model/resource.rb,
lib/aliyun/odps/service_object.rb,
lib/aliyun/odps/model/functions.rb,
lib/aliyun/odps/model/instances.rb,
lib/aliyun/odps/model/resources.rb,
lib/aliyun/odps/model/task_result.rb,
lib/aliyun/odps/model/table_column.rb,
lib/aliyun/odps/model/table_schema.rb,
lib/aliyun/odps/model/instance_task.rb,
lib/aliyun/odps/tunnel/upload_block.rb,
lib/aliyun/odps/tunnel/table_tunnels.rb,
lib/aliyun/odps/model/table_partition.rb,
lib/aliyun/odps/tunnel/upload_session.rb,
lib/aliyun/odps/model/table_partitions.rb,
lib/aliyun/odps/tunnel/download_session.rb

Defined Under Namespace

Modules: Modelable, Struct Classes: Authorization, Client, Configuration, DownloadSession, Error, Function, Functions, Http, Instance, InstanceNameInvalidError, InstanceTask, InstanceTaskNotSuccessError, Instances, List, MissingProjectConfigurationError, PriorityInvalidError, Project, Projects, RecordNotMatchSchemaError, RequestError, Resource, ResourceMissingContentError, Resources, ServiceObject, Table, TableColumn, TablePartition, TablePartitions, TableSchema, TableTunnels, Tables, TaskResult, TunnelEndpointMissingError, TunnelRouter, UploadBlock, UploadSession, Utils, ValueNotSupportedError, XmlElementMissingError

Constant Summary collapse

VERSION =
'0.4.1'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configuration=(value) ⇒ Object (writeonly)

Sets the attribute configuration

Parameters:

  • value

    the value to set the attribute configuration to.



19
20
21
# File 'lib/aliyun/odps.rb', line 19

def configuration=(value)
  @configuration = value
end

Class Method Details

.configConfiguration

return current configuration

Returns:



41
42
43
# File 'lib/aliyun/odps.rb', line 41

def config
  @configuration
end

.configure {|@configuration| ... } ⇒ Object

Config Odps

Examples:


Aliyun::Odps.configure do |config|
  config.access_key = 'your-access-key'
  config.secret_key = 'your-secret-key'
  config.endpoint = 'odps-api-endpoint'  # 'http://service.odps.aliyun.com/api' or 'http://odps-ext.aliyun-inc.com/api'
  config.project = 'your-default-project-name'
  config.tunnel_endpoint = 'odps-tunnel-api-endpoint'  # if you not config it, we will auto detect it
end

Yields:

  • (@configuration)


32
33
34
35
36
# File 'lib/aliyun/odps.rb', line 32

def configure
  @configuration ||= Configuration.new
  yield @configuration if block_given?
  @configuration
end

.list_projects(options = {}) ⇒ List Also known as: projects

Parameters:

  • options (Hash) (defaults to: {})

    options

Options Hash (options):

  • :owner (String)

    specify the project owner

  • :marker (String)

    specify marker for paginate

  • :maxitems (String) — default: 1000

    specify maxitems in this request

Returns:

See Also:



57
58
59
# File 'lib/aliyun/odps.rb', line 57

def list_projects(options = {})
  client.projects.list(options)
end

.project(name = config.project) ⇒ Project Also known as: get_project

Get project

Parameters:

  • name (String) (defaults to: config.project)

    specify project name, default is project in config

Returns:



50
51
52
53
# File 'lib/aliyun/odps.rb', line 50

def project(name = config.project)
  fail MissingProjectConfigurationError unless name
  client.projects.get(name)
end

.update_project(name, options = {}) ⇒ Object

Update Project Information

Options Hash (options):

  • :comment (String)

    Comment of the project

Returns:

  • true

See Also:



63
64
65
# File 'lib/aliyun/odps.rb', line 63

def update_project(name, options = {})
  client.projects.update(name, options)
end