Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 98 lines (59 sloc) 5.402 kb
d073555 Initial commit. Working version.
Joost Hietbrink authored
1 = TransIP API
2
c377a74 @joost Added support for full API v5.0 (including VPS services).
authored
3 Ruby gem to use the full TransIP (www.transip.nl) API (v5.0).
4 Uses an updated version of savon and implements the new request signing method that the guys at TransIP have introduced into their API.
2b14529 renamed repo and updated bundle
Richard Bronkhorst authored
5
c377a74 @joost Added support for full API v5.0 (including VPS services).
authored
6 The TransIP API makes use of public/private key encryption. You need to use the TransIP
7 control panel to give your server access to the API and to generate a key. You can then
8 use the key together with your username to gain access to the API.
2b14529 renamed repo and updated bundle
Richard Bronkhorst authored
9
d073555 Initial commit. Working version.
Joost Hietbrink authored
10 For more info see:
11
be5b3cd @joost Merge
authored
12 * <b>The origin of this code:</b> https://github.com/joost/transip
5adfb21 Super improved Github docs.
Joost Hietbrink authored
13 * <b>TransIP API Docs:</b> https://www.transip.nl/g/api
d073555 Initial commit. Working version.
Joost Hietbrink authored
14
15 == Install
16
174dd65 @joost Doc change.
authored
17 Install from rubygems (rubygems.org/gems/transip):
18
19 gem install transip
20
21 or add in your Bundle Gemfile:
22
23 gem 'transip'
24
ec5d728 Now a gem.
Joost Hietbrink authored
25 For the latest version: Download / clone the repository. Bundle install the needed gems and require the lib.
d073555 Initial commit. Working version.
Joost Hietbrink authored
26
c24f853 @joost Readme fix.
authored
27 git clone https://github.com/joost/transip.git
2b14529 renamed repo and updated bundle
Richard Bronkhorst authored
28 cd transip
d073555 Initial commit. Working version.
Joost Hietbrink authored
29 bundle install
2b14529 renamed repo and updated bundle
Richard Bronkhorst authored
30 irb # and require './lib/transip'
d073555 Initial commit. Working version.
Joost Hietbrink authored
31
1e7e100 @joost Fixes and doc changes.
authored
32 == API Credentials
33
34 Enable the TransIP API via https://www.transip.nl/cp/mijn-account/#api.
35 Make sure:
36 * you enable the API
37 * add your IP to the access list
5d88e82 @richmans Updated README.rdoc to mention ipv6
richmans authored
38 * If your host supports ipv6, also add your ipv6 ip!
1e7e100 @joost Fixes and doc changes.
authored
39 * create and save your RSA private key
40
d073555 Initial commit. Working version.
Joost Hietbrink authored
41 == Usage
42
1e7e100 @joost Fixes and doc changes.
authored
43 For the most up-to-date documentation see the source files.
44
45 Setup the API client:
46
47 # use this in production
c377a74 @joost Added support for full API v5.0 (including VPS services).
authored
48 transip = Transip::DomainClient.new(username: 'your_username', key: 'your_private_rsa_key', ip: '12.34.12.3', mode: :readwrite)
49
b3153a3 @edwardmp Added support for proxy (e.g. QuotaGuard Static on Heroku)
edwardmp authored
50
c377a74 @joost Added support for full API v5.0 (including VPS services).
authored
51 You can use Transip::DomainClient, Transip::VpsClient, Transip::ColocationClient, Transip::WebhostingClient and Transip::ForwardClient.
1e7e100 @joost Fixes and doc changes.
authored
52
53 In development you can leave out the ip. To test request use :readonly mode.
54
c377a74 @joost Added support for full API v5.0 (including VPS services).
authored
55 If you store your private key in a seperate file you can do:
56
57 transip = Transip::DomainClient.new(username: 'your_username', key_file: 'path_to_your_private_key_file', ip: '12.34.12.3', mode: :readwrite)
58
b3153a3 @edwardmp Added support for proxy (e.g. QuotaGuard Static on Heroku)
edwardmp authored
59 === Using a proxy for routing traffic to TransIP
1958b94 @edwardmp Readme typo
edwardmp authored
60 transip = Transip::DomainClient.new(username: 'your_username', key: 'your_private_rsa_key', ip: '12.34.12.3', mode: :readwrite, proxy: ENV["QUOTAGUARDSTATIC_URL"])
b3153a3 @edwardmp Added support for proxy (e.g. QuotaGuard Static on Heroku)
edwardmp authored
61
1958b94 @edwardmp Readme typo
edwardmp authored
62 If you want to use a proxy through which you want to route the API calls to TransIP, you can supply the proxy parameter. For example, I use QuotaGuard Static (https://addons.heroku.com/quotaguardstatic) on Heroku. First install the addon, you will receive two static IP addresses. Whitelist these in the TransIP API settings page. Next, supply the proxy url. For instance, I use the environment variable QUOTAGUARDSTATIC_URL to supply this URL.
b3153a3 @edwardmp Added support for proxy (e.g. QuotaGuard Static on Heroku)
edwardmp authored
63
c377a74 @joost Added support for full API v5.0 (including VPS services).
authored
64 === DomainClient
65
66 transip = Transip::DomainClient.new(username: 'your_username', key: 'your_private_rsa_key', ip: '12.34.12.3', mode: :readwrite)
67
1e7e100 @joost Fixes and doc changes.
authored
68 transip.actions # => [:batch_check_availability, :check_availability, :get_whois, :get_domain_names, :get_info, :batch_get_info, :get_auth_code, :get_is_locked, :register, :cancel, :transfer_with_owner_change, :transfer_without_owner_change, :set_nameservers, :set_lock, :unset_lock, :set_dns_entries, :set_owner, :set_contacts, :get_all_tld_infos, :get_tld_info, :get_current_domain_action, :retry_current_domain_action_with_new_data, :retry_transfer_with_different_auth_code, :cancel_domain_action]
d073555 Initial commit. Working version.
Joost Hietbrink authored
69
70 transip.request(:get_domain_names)
56c0a4d better result class mapping
Richard Bronkhorst authored
71 transip.request(:get_info, :domain_name => 'example.com')
72 transip.request(:get_whois, :domain_name => 'example.com')
73 transip.request(:set_dns_entries, :domain_name => 'example.com', :dns_entries => [Transip::DnsEntry.new('test', 5.inutes, 'A', '74.125.77.147')])
c377a74 @joost Added support for full API v5.0 (including VPS services).
authored
74 transip.request(:register, Transip::Domain.new('example.com', nil, nil, [Transip::DnsEntry.new('test', 300, 'A', '74.125.77.147')]))
ba36211 updated doc
Richard Bronkhorst authored
75 transip.request(:set_contacts, :domain_name => 'example.com', :contacts => [Transip::WhoisContact.new('type', 'first', 'middle', 'last', 'company', 'kvk', 'companyType', 'street', 'number', 'postalCode', 'city', 'phoneNumber', 'faxNumber', 'email', 'country')])
56c0a4d better result class mapping
Richard Bronkhorst authored
76
c377a74 @joost Added support for full API v5.0 (including VPS services).
authored
77 === VpsClient
78
79 transip_vps = Transip::VpsClient.new(username: 'your_username', key: 'your_private_rsa_key', ip: '12.34.12.3', mode: :readwrite)
80
81 transip_vps.actions # => [:get_available_products, :get_available_addons, :get_active_addons_for_vps, :get_available_upgrades, :get_available_addons_for_vps, :get_cancellable_addons_for_vps, :order_vps, :order_addon, :order_private_network, :upgrade_vps, :cancel_vps, :cancel_addon, :cancel_private_network, :get_private_networks_by_vps, :get_all_private_networks, :add_vps_to_private_network, :remove_vps_from_private_network, :get_amount_of_traffic_used, :start, :stop, :reset, :create_snapshot, :revert_snapshot, :remove_snapshot, :get_vps, :get_vpses, :get_snapshots_by_vps, :get_operating_systems, :install_operating_system, :get_ips_for_vps, :get_all_ips, :add_ipv6_to_vps, :update_ptr_record]
82
f8c4eea @joost Added some more docs.
authored
83 transip_vps.request(:get_available_products)
84 transip_vps.request(:get_operating_systems)
85 transip_vps.request(:order_vps, product_name: 'vps-bladevps-x1', addons: nil, operating_system_name: 'ubuntu-12.04.1-transip', hostname: 'my.hostname.com')
86
792a779 @joost Added some more docs.
authored
87 === ColocationClient, WebhostingClient and ForwardClient
88
89 Same as above.
90
91 Find out full methods and parameters by going throught the PHP sources of the TransIP API. You can find them via www.transip.nl.
92
c377a74 @joost Added support for full API v5.0 (including VPS services).
authored
93 == Contribute and licence
94
d073555 Initial commit. Working version.
Joost Hietbrink authored
95 Please feel free to contribute and send me a pull request via Github!
96
db900e7 @joost Merge fixes.
authored
97 (C)opyright 2014 Joost Hietbrink / Richard Bronkhorst, released under the MIT license.
Something went wrong with that request. Please try again.