Method: Fog::Rackspace::Databases::Real#create_database

Defined in:
lib/fog/rackspace/requests/databases/create_database.rb

#create_database(instance_id, name, options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/fog/rackspace/requests/databases/create_database.rb', line 5

def create_database(instance_id, name, options = {})
  data = {
    'databases' => [{
      'name' => name,
      'character_set' => options[:character_set],
      'collate' => options[:collate]
    }]
  }

  request(
    :body => Fog::JSON.encode(data),
    :expects => 202,
    :method => 'POST',
    :path => "instances/#{instance_id}/databases"
  )
end