diff --git a/lib/fog/hp/requests/dns/create_domain.rb b/lib/fog/hp/requests/dns/create_domain.rb deleted file mode 100644 index 550a6896f..000000000 --- a/lib/fog/hp/requests/dns/create_domain.rb +++ /dev/null @@ -1,39 +0,0 @@ -module Fog - module HP - class DNS - - class Real - def create_domain(name, email) - data = { - name: name, - email:email - } - request( - :body => MultiJson.encode(data), - :expects => 200, - :method => 'POST', - :path => 'domains.json' - ) - end - end - - class Mock - def create_domain(name,email) - response = Excon::Response.new - response.status = 200 - - data = { - id : SecureRandom.uuid, - name : "domain1.com.", - ttl : 3600, - serial : 1351800588, - email : "nsadmin@example.org", - created_at : "2012-11-01T20:09:48.094457" - } - response.body = data - response - end - end - end - end -end \ No newline at end of file diff --git a/lib/fog/hp/requests/dns/create_record.rb b/lib/fog/hp/requests/dns/create_record.rb deleted file mode 100644 index d8086b627..000000000 --- a/lib/fog/hp/requests/dns/create_record.rb +++ /dev/null @@ -1,44 +0,0 @@ -module Fog - module HP - class DNS - class Real - def create_record(domain_id, name, type, data) - - data = { - name: name, - type: type, - data: data - } - - request( - :body => MultiJson.encode(data), - :expects => 200, - :method => 'POST', - :path => "domains/#{domain_id}/records" - ) - - end - end - class Mock - def create_record(domain_id, name, type, data) - response = Excon::Response.new - response.status = 200 - data = { - id : "2e32e609-3a4f-45ba-bdef-e50eacd345ad", - name : "www.example.com.", - type : "A", - created_at : "2012-11-02T19:56:26.366792", - updated_at : null, - domain_id : "89acac79-38e7-497d-807c-a011e1310438", - ttl : 3600, - data : "15.185.172.152", - } - response.body = data - response - response - end - end - end - end -end - diff --git a/lib/fog/hp/requests/dns/delete_domain.rb b/lib/fog/hp/requests/dns/delete_domain.rb deleted file mode 100644 index dcd577e7b..000000000 --- a/lib/fog/hp/requests/dns/delete_domain.rb +++ /dev/null @@ -1,43 +0,0 @@ -module Fog - module HP - class DNS - - class Real - - # Delete a Domain - # - # ==== Parameters - # * domain_id<~Integer> - Id of domain to delete - # - def delete_domain(domain_id) - request( - :expects => 200, - :method => 'DELETE', - :path => "domains/#{domain_id}" - ) - end - - end - - class Mock - def delete_domain(domain_id) - response = Excon::Response.new - if image = find_domain(domain_id) - response.status = 202 - response - else - response.status = 404 - raise(Excon::Errors.status_error({:expects => 200}, response)) - end - response - end - - def find_domain(domain_id) - list_domains.body['domains'].detect { |_| _['id'] == domain_id } - end - - end - - end - end -end \ No newline at end of file diff --git a/lib/fog/hp/requests/dns/delete_record.rb b/lib/fog/hp/requests/dns/delete_record.rb deleted file mode 100644 index eb3f67b74..000000000 --- a/lib/fog/hp/requests/dns/delete_record.rb +++ /dev/null @@ -1,44 +0,0 @@ -module Fog - module HP - class DNS - class Real - # Delete a Record - # - # ==== Parameters - # * domain_id<~Integer> - Id of domain for record - # * record_id<~Integer> - Id of record to delete - # - def delete_record(domain_id, record_id) - - - request( - :expects => 200, - :method => 'DELETE', - :path => "domains/#{domain_id}/records/#{record_id}" - ) - - end - end - - class Mock - def delete_record(domain_id, record_id) - response = Excon::Response.new - if image = find_record(domain_id,record_id) - response.status = 200 - response - else - response.status = 404 - raise(Excon::Errors.status_error({:expects => 200}, response)) - end - response - end - - def find_record(domain_id, record_id) - list_records_in_a_domain(domain_id).body['records'].detect { |_| _['id'] == record_id } - end - end - - end - end -end -end \ No newline at end of file diff --git a/lib/fog/hp/requests/dns/get_domain.rb b/lib/fog/hp/requests/dns/get_domain.rb deleted file mode 100644 index d23f4b3d6..000000000 --- a/lib/fog/hp/requests/dns/get_domain.rb +++ /dev/null @@ -1,40 +0,0 @@ -module Fog - module HP - class DNS - - # Get details for existing domain - # - # ==== Parameters - # * instance_id<~Integer> - Id of the domain to get - # - # ==== Returns - # * response<~Excon::Response>: - # *TBD - class Real - def get_domain(instance_id) - response = request( - :expects => 200, - :method => 'GET', - :path => "domains/#{instance_id}", - ) - response - end - end - class Mock - - def get_domain(instance_id) - response = Excon::Response.new - if domain = find_domain(instance_id) - response.status = 200 - response.body = {'domain' => domain} - response - else - response.status = 400 - raise(Excon::Errors.status_error({:expects => 200}, response)) - end - response - end - end - end - end -end \ No newline at end of file diff --git a/lib/fog/hp/requests/dns/get_record.rb b/lib/fog/hp/requests/dns/get_record.rb deleted file mode 100644 index bb20e3d92..000000000 --- a/lib/fog/hp/requests/dns/get_record.rb +++ /dev/null @@ -1,34 +0,0 @@ -module Fog - module HP - class DNS - class Real - def get_record(domain_id,record_id) - response = request( - :expects => 200, - :method => 'GET', - :path => "domains/#{domain_id}/records/#{record_id}", - ) - response - end - end - class Mock - def get_record(domain_id,record_id) - if record = find_record(domain_id,record_id) - response.status = 200 - response.body = record - response - else - response.status = 400 - raise(Excon::Errors.status_error({:expects => 200}, response)) - end - - response - end - - def find_record(domain_id, record_id) - list_records_in_a_domain(domain_id).body['records'].detect { |_| _['id'] == record_id } - end - end - end - end -end \ No newline at end of file diff --git a/lib/fog/hp/requests/dns/get_servers_hosting_domain.rb b/lib/fog/hp/requests/dns/get_servers_hosting_domain.rb deleted file mode 100644 index 34e27604b..000000000 --- a/lib/fog/hp/requests/dns/get_servers_hosting_domain.rb +++ /dev/null @@ -1,40 +0,0 @@ -module Fog - module HP - class DNS - class Real - # Get servers for existing domain - # - # ==== Parameters - # * instance_id<~Integer> - Id of the domain with servers - # - # ==== Returns - # * response<~Excon::Response>: - # *TBD - def get_servers_hosting_domain(instance_id) - request( - :expects => [200, 203], - :method => 'GET', - :path => "domains/#{instance_id}/servers.json" - ) - end - - end - - class Mock - - def get_servers_hosting_domain(instance_id) - if domain = find_domain(instance_id) - response.status = 200 - response.body = {'domain' => domain} - response - else - response.status = 400 - raise(Excon::Errors.status_error({:expects => 200}, response)) - end - response - end - - end - end - end -end \ No newline at end of file diff --git a/lib/fog/hp/requests/dns/list_domains.rb b/lib/fog/hp/requests/dns/list_domains.rb deleted file mode 100644 index 8c5378af9..000000000 --- a/lib/fog/hp/requests/dns/list_domains.rb +++ /dev/null @@ -1,33 +0,0 @@ -module Fog - module HP - module DNS - class Real - # List all flavors (IDs and names only) - - def list_domains - request( - :expects => [200], - :method => 'GET', - :path => 'domains', - ) - end - - end - - class Mock - def list_domains - response = Excon::Response.new - response.status = 200 - response.body = { - "domains" => [ - { "name" => "domain1.com.", "created_at" => "2012-11-01T20:11:08.000000", "email" => "nsadmin@example.org", "ttl" => 3600, "serial" => 1351800668, "id" => "09494b72-b65b-4297-9efb-187f65a0553e" }, - { "name" => "domain2.com.", "created_at" => "2012-11-01T20:09:48.000000", "email" => "nsadmin@example.org", "ttl" => 3600, "serial" => 1351800588, "id" => "89acac79-38e7-497d-807c-a011e1310438" } - ] - } - response - end - - end - end - end -end \ No newline at end of file diff --git a/lib/fog/hp/requests/dns/list_records_in_a_domain.rb b/lib/fog/hp/requests/dns/list_records_in_a_domain.rb deleted file mode 100644 index fed51a797..000000000 --- a/lib/fog/hp/requests/dns/list_records_in_a_domain.rb +++ /dev/null @@ -1,50 +0,0 @@ -module Fog - module HP - class DNS - class Real - def list_records_in_a_domain(domain_id) - - end - - end - class Mock - def list_records_in_a_domain(domain_id) - response = Excon::Response.new - response.status = 200 - response.body = { - "records" => [ - { - "id" => "2e32e609-3a4f-45ba-bdef-e50eacd345ad", - "name" => "www.example.com.", - "type" => "A", - "ttl" => 3600, - "created_at" => "2012-11-02T19:56:26.000000", - "updated_at" => "2012-11-04T13:22:36.000000", - "data" => "15.185.172.153", - "domain_id" => "89acac79-38e7-497d-807c-a011e1310438", - "tenant_id" => null, - "priority" => null, - "version" => 1, - }, - { - "id" => "8e9ecf3e-fb92-4a3a-a8ae-7596f167bea3", - "name" => "host1.example.com.", - "type" => "A", - "ttl" => 3600, - "created_at" => "2012-11-04T13:57:50.000000", - "updated_at" => null, - "data" => "15.185.172.154", - "domain_id" => "89acac79-38e7-497d-807c-a011e1310438", - "tenant_id" => null, - "priority" => null, - "version" => 1 - } - ] - } - response - end - end - - end - end -end \ No newline at end of file diff --git a/lib/fog/hp/requests/dns/update_domain.rb b/lib/fog/hp/requests/dns/update_domain.rb deleted file mode 100644 index f5400ef98..000000000 --- a/lib/fog/hp/requests/dns/update_domain.rb +++ /dev/null @@ -1,33 +0,0 @@ -module Fog - module HP - class DNS - - class Real - def update_domain(domain_id,options) - request( - :body => MultiJson.encode(options), - :expects => 200, - :method => 'PUT', - :path => "domains/#{domain_id}" - ) - end - end - - class Mock - def update_domain(domain_id, options) - response = Excon::Response.new - if domain = list_domains.body['domains'].detect { |_| _['id'] == domain_id } - if options['name'] - domain['name'] = options['name'] - end - response.status = 200 - response.body = domain - response - else - raise Fog::HP::DNS::NotFound - end - end - end - end - end -end \ No newline at end of file diff --git a/lib/fog/hp/requests/dns/update_record.rb b/lib/fog/hp/requests/dns/update_record.rb deleted file mode 100644 index 49208038f..000000000 --- a/lib/fog/hp/requests/dns/update_record.rb +++ /dev/null @@ -1,39 +0,0 @@ -module Fog - module HP - class DNS - - class Real - def update_record(domain_id, record_id, options) - request( - :body => MultiJson.encode(options), - :expects => 200, - :method => 'PUT', - :path => "domains/#{domain_id}/records/#{record_id}" - ) - end - - end - - class Mock - def update_record(domain_id , record_id, options) - if record = find_record(domain_id, record_id) - if options['name'] - domain['name'] = options['name'] - end - response.status = 200 - response.body = record - response - else - raise Fog::HP::DNS::NotFound - end - response - end - - def find_record(domain_id, record_id) - list_records_in_a_domain(domain_id).body['records'].detect { |_| _['id'] == record_id } - end - end - - end - end -end \ No newline at end of file diff --git a/tests/hp/requests/dns/create_domain_tests.rb b/tests/hp/requests/dns/create_domain_tests.rb deleted file mode 100644 index 31f1e951a..000000000 --- a/tests/hp/requests/dns/create_domain_tests.rb +++ /dev/null @@ -1,17 +0,0 @@ -Shindo.tests("HP::DNS | create domain tests", ['hp', 'dns', 'domain']) do - - @create_format = { - "id " => String, - "name" => String, - "ttl" => Integer, - "serial" => Integer, - "email" => String, - "created_at" => String - } - - tests('success') do - tests("#create_domain").formats(@create_format) do - HP[:dns].create_domain_now("name","joe@blow.com") - end - end -end diff --git a/tests/hp/requests/dns/delete_domain_tests.rb b/tests/hp/requests/dns/delete_domain_tests.rb deleted file mode 100644 index 44031b3d5..000000000 --- a/tests/hp/requests/dns/delete_domain_tests.rb +++ /dev/null @@ -1,9 +0,0 @@ -Shindo.tests("HP::DNS | delete domain tests", ['hp', 'dns', 'domain']) do - tests('success') do - - end - tests('failure') do - - end - -end \ No newline at end of file diff --git a/tests/hp/requests/dns/get_domain_tests.rb b/tests/hp/requests/dns/get_domain_tests.rb deleted file mode 100644 index afe8f588b..000000000 --- a/tests/hp/requests/dns/get_domain_tests.rb +++ /dev/null @@ -1,9 +0,0 @@ -Shindo.tests("HP::DNS | get domain tests", ['hp', 'dns', 'domain']) do - tests('success') do - - end - tests('failure') do - - end - -end \ No newline at end of file diff --git a/tests/hp/requests/dns/get_servers_hosting_domain_tests.rb b/tests/hp/requests/dns/get_servers_hosting_domain_tests.rb deleted file mode 100644 index c71dd4d81..000000000 --- a/tests/hp/requests/dns/get_servers_hosting_domain_tests.rb +++ /dev/null @@ -1,9 +0,0 @@ -Shindo.tests("HP::DNS | get servers hosting domain tests", ['hp', 'dns', 'domain']) do - tests('success') do - - end - tests('failure') do - - end - -end \ No newline at end of file diff --git a/tests/hp/requests/dns/list_domains_tests.rb b/tests/hp/requests/dns/list_domains_tests.rb deleted file mode 100644 index 6b5f9a92a..000000000 --- a/tests/hp/requests/dns/list_domains_tests.rb +++ /dev/null @@ -1,9 +0,0 @@ -Shindo.tests("HP::DNS | list domains tests", ['hp', 'dns', 'domain']) do - tests('success') do - - end - tests('failure') do - - end - -end \ No newline at end of file diff --git a/tests/hp/requests/dns/list_records_tests.rb b/tests/hp/requests/dns/list_records_tests.rb deleted file mode 100644 index 4ba49e53e..000000000 --- a/tests/hp/requests/dns/list_records_tests.rb +++ /dev/null @@ -1,9 +0,0 @@ -Shindo.tests("HP::DNS | list records tests", ['hp', 'dns', 'records']) do - tests('success') do - - end - tests('failure') do - - end - -end \ No newline at end of file diff --git a/tests/hp/requests/dns/update_domain_tests.rb b/tests/hp/requests/dns/update_domain_tests.rb deleted file mode 100644 index e72b8838e..000000000 --- a/tests/hp/requests/dns/update_domain_tests.rb +++ /dev/null @@ -1,9 +0,0 @@ -Shindo.tests("HP::DNS | list records tests", ['hp', 'dns', 'domains']) do - tests('success') do - - end - tests('failure') do - - end - -end \ No newline at end of file