Skip to content

Commit

Permalink
test rst
Browse files Browse the repository at this point in the history
  • Loading branch information
houluy committed Aug 3, 2017
1 parent 47fdbbc commit 7e37982
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
Aliyun SMS SDK's documentation
==============================

.. toctree::
:maxdepth: 2
:caption: Contents:

Installation
===========

Expand All @@ -22,6 +18,7 @@ AliyunSMS Object has the following attributes and methods::
class aliyun_sms.AliyunSMS(config_file='', access_key_id='', access_key_secret='', region_id='', host='http://dysmsapi.aliyuncs.com')

*Class*

* `config_file`: Configure file name
* `access_key_id`: accessKeyId of Aliyun *sub-account* (*subaccount* is recommended for security)
* `access_key_secret`: accessKeySecret of the id (vital)
Expand All @@ -32,14 +29,16 @@ AliyunSMS Object has the following attributes and methods::

AliyunSMS Public Attributes
===========================
::

::
AliyunSMS.sms_params

This is the `dict` of parameters for SMS request. It can be get and set directly (A `dict` is mandatory)

AliyunSMS Methods
=================
::

::
AliyunSMS.generate_signature(params=None, method='GET', url='/')

This function can generate signature based on the `params`, `method` and `url`. Of course `access_key_secret` is necessary!
Expand All @@ -49,7 +48,7 @@ This function can generate signature based on the `params`, `method` and `url`.

% The signature string

::
::
AliyunSMS.send_sms(phone_numbers, sign_name, template_code, template_params=None, raw=True, **kwargs)
This function is used to send SMS via Aliyun API.
Expand All @@ -61,11 +60,12 @@ This function is used to send SMS via Aliyun API.

% Status: success or failure

::
::
AliyunSMS.query_details(phone_number, serial_number='', send_date='', page_size='10', current_page='1', raw=True, **kwargs)
This function is used to query sending histories specified by `phone_number` and `send_date`.
* `phone_number1`: Only one phone number.

* `phone_number1`: Only one phone number.
* `serial_number`: Serial number of a SMS message, can be received from return of `send_sms`.
* `send_date`: Search date, less than 30 days, form: `20170801`.
* `page_size`: Paging, max 50 items a page.
Expand All @@ -76,17 +76,18 @@ This function is used to query sending histories specified by `phone_number` and

Useful Functions
================
::

::
utils.hmac64(object_str, secret, alg='sha1')

Compute the *HMAC-\{alg\}* of the `object\_str` with `secret` and get the return after `base64` encoding
* `object_str`: Original string that needs to be encrypted.
* `secret`: secret string.
* `alg`: HMAC algorithm, default `sha1`.

% The encrypted string
% The encrypted string

::
::
utils.parse_config(config_file, part='_all')

Parse config file, a *YAML* file is mandatory
Expand All @@ -95,10 +96,3 @@ Parse config file, a *YAML* file is mandatory

% The configures in `dict`


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

0 comments on commit 7e37982

Please sign in to comment.