diff --git a/include/erlcloud_aws.hrl b/include/erlcloud_aws.hrl index 0120c326..bd5deeb7 100644 --- a/include/erlcloud_aws.hrl +++ b/include/erlcloud_aws.hrl @@ -8,7 +8,7 @@ mturk_host="mechanicalturk.amazonaws.com"::string(), mon_host="monitoring.amazonaws.com"::string(), mon_port=undefined::non_neg_integer()|undefined, - mon_prot=undefined::string()|undefined, + mon_protocol=undefined::string()|undefined, access_key_id::string(), secret_access_key::string() }). diff --git a/src/erlcloud_aws.erl b/src/erlcloud_aws.erl index 3f004980..86bc9b1c 100644 --- a/src/erlcloud_aws.erl +++ b/src/erlcloud_aws.erl @@ -10,13 +10,13 @@ aws_request_xml(Method, Host, Path, Params, AccessKeyID, SecretAccessKey) -> Body = aws_request(Method, Host, Path, Params, AccessKeyID, SecretAccessKey), element(1, xmerl_scan:string(Body)). -aws_request_xml(Method, Prot, Host, Port, Path, Params, AccessKeyID, SecretAccessKey) -> - Body = aws_request(Method, Prot, Host, Port, Path, Params, AccessKeyID, SecretAccessKey), +aws_request_xml(Method, Protocol, Host, Port, Path, Params, AccessKeyID, SecretAccessKey) -> + Body = aws_request(Method, Protocol, Host, Port, Path, Params, AccessKeyID, SecretAccessKey), element(1, xmerl_scan:string(Body)). aws_request(Method, Host, Path, Params, AccessKeyID, SecretAccessKey) -> aws_request(Method, undefined, Host, undefined, Path, Params, AccessKeyID, SecretAccessKey). -aws_request(Method, Prot, Host, Port, Path, Params, AccessKeyID, SecretAccessKey) -> +aws_request(Method, Protocol, Host, Port, Path, Params, AccessKeyID, SecretAccessKey) -> Timestamp = format_timestamp(erlang:universaltime()), QParams = lists:sort([{"Timestamp", Timestamp}, {"SignatureVersion", "2"}, @@ -30,14 +30,14 @@ aws_request(Method, Prot, Host, Port, Path, Params, AccessKeyID, SecretAccessKey Query = [QueryToSign, "&Signature=", erlcloud_http:url_encode(Signature)], - case Prot of - undefined -> UProt = "https://"; - _ -> UProt = [Prot, "://"] + case Protocol of + undefined -> UProtocol = "https://"; + _ -> UProtocol = [Protocol, "://"] end, case Port of - undefined -> URL = [UProt, Host, Path]; - _ -> URL = [UProt, Host, $:, port_to_str(Port), Path] + undefined -> URL = [UProtocol, Host, Path]; + _ -> URL = [UProtocol, Host, $:, port_to_str(Port), Path] end, Response = diff --git a/src/erlcloud_mon.erl b/src/erlcloud_mon.erl index 80c5d20d..f673230d 100644 --- a/src/erlcloud_mon.erl +++ b/src/erlcloud_mon.erl @@ -252,7 +252,7 @@ mon_query(Config, Action, Params) -> mon_query(Config, Action, Params, ApiVersion) -> QParams = [{"Action", Action}, {"Version", ApiVersion}|Params], erlcloud_aws:aws_request_xml(get, - Config#aws_config.mon_prot, + Config#aws_config.mon_protocol, Config#aws_config.mon_host, Config#aws_config.mon_port, "/", @@ -266,7 +266,7 @@ configure_host(Host, Port, Protocol) -> Config = default_config(), NewConfig = Config#aws_config{mon_host=Host, mon_port=Port, - mon_prot=Protocol}, + mon_protocol=Protocol}, put(aws_config, NewConfig).