def register_service(long_name, service_name, service_home_dir_path, options = {})
      # Entry point
      url = "#{@client.app_info[:launcher_server]}#{API_VERSION}/dns"

      # Payload
      payload = {
        longName: long_name,
        serviceName: service_name,
        rootPath: 'app',
        serviceHomeDirPath: service_home_dir_path,
      }

      # Optional
      payload["metadata"] = options[:meta] if options.has_key?(:meta)

      # API call
      uri = URI(url)
      http = Net::HTTP.new(uri.host, uri.port)
      req = Net::HTTP::Post.new(uri.path, {
        'Authorization' => "Bearer #{@client.key_helper.get_valid_token()}",
        'Content-Type' => 'application/json'
      })
      req.body = payload.to_json
      res = http.request(req)
      res.code == "200" ? true : JSON.parse(res.body)
    end
def register_service(long_name, service_name, service_home_dir_path, options = {})
      # Entry point
      url = "#{@client.app_info[:launcher_server]}#{API_VERSION}/dns"

      # Payload
      payload = {
        longName: long_name,
        serviceName: service_name,
        rootPath: 'app',
        serviceHomeDirPath: service_home_dir_path,
      }

      # Optional
      payload["metadata"] = options[:meta] if options.has_key?(:meta)

      # API call
      uri = URI(url)
      http = Net::HTTP.new(uri.host, uri.port)
      req = Net::HTTP::Post.new(uri.path, {
        'Authorization' => "Bearer #{@client.key_helper.get_valid_token()}",
        'Content-Type' => 'application/json'
      })
      req.body = payload.to_json
      res = http.request(req)
      res.code == "200" ? true : JSON.parse(res.body)
    end
Register a long name and a service.
 Only authorised requests can invoke the API.

 Usage: my_client.dns.register_service("my-domain", "www", "/sources")
 Fail: {"errorCode"=>-1503, "description"=>"FfiError::InvalidPath"}
 Success: true

 Reference: https://maidsafe.readme.io/docs/dns-register-service