-
Notifications
You must be signed in to change notification settings - Fork 0
Home
sroche0 edited this page Oct 26, 2015
·
7 revisions
Help on module apperian:
NAME apperian - # coding=utf-8
FILE /Users/sroche/AeroFS/Python/Projects/apperian/apperian/apperian.py
CLASSES Ease Publish
class Ease | Methods defined here: | | __init__(self, user, pw, region='default') | | app_data(self, psk) | List data for a specific app | | :param psk: Unique ID of the app | :return: Returns dict of metadata about the specified application. Specify the app with app_psk. | | app_list_all(self) | List application data about all the native applications stored in the EASE database for the authenticated | user’s organization. | | :return: Dict with key:value pairs of the app psk and it's metadata. For example: {123:{METADATA}} | | app_list_available(self) | List application data about all the applications available in EASE to the authenticated user. An application is | considered available if it is assigned to a group to which the user belongs | | :return: Dict with key:value pairs of the app psk and it's metadata. For example: {123:{METADATA}} | | app_list_catalogs(self) | List data for all app catalogs | | :return: Returns data about all the App Catalogs in the authenticated user's organization | | app_toggle(self, app_psk, state) | Allows you do enable or disable and app in your account. | | :param app_psk: Unique ID of the app. Use the app_list_available() method | :param state: Boolean Value of desired state of the app | :return: Dict of request status | | app_usage(self, psk, start_date, end_date) | List download and usage count for a specific app | | :param psk: Unique ID for the app. | :param start_date: Start date for the statistical period. For example: 2014-01-15 | :param end_date: End date for the statistical period. For example: 2014-01-30 | :return:Returns Download Count and Usage Count for an application during a specified statistical time period. | | auth(self, user=None, password=None) | Authenticate user to the python API. If user and password params are left blank, function will use the | credentials instance was started with | | :param user: User ID for a valid EASE user in your organization’s EASE account | :param password: User’s password | :return: Boolean | | group_add(self, data) | Adds a new group to the authenticated user’s organization. | | :param data: Dict with metadata for group. Required keys are: group_name, group_description | :return: Dict of new groups details. Dict keys are: psk, name, description | | https://apidocs.apperian.com/v1/groups.html | | group_add_apps(self, group_psk, app_list) | Adds applications to a specified group. Specify apps by app_psk. | | :param group_psk: Unique ID assigned by EASE to the group. | :param app_list: Comma-separated list of the app_psks for the applications you want to add to the group. | :return: Dict of lists. Dict keys are: apps_added, apps_failed | | group_add_member(self, user_psk, groups) | Adds a specified user to a list of groups. Specify groups by group_psk. | | :param user_psk: Unique ID assigned by EASE to the user you want to add to the list of groups | :param groups: Comma-separated list of the group psks | :return:Dict of lists. Dict keys are: added_groups, failed_groups | | https://apidocs.apperian.com/v1/groups.html | | group_add_members(self, group_psk, user_list) | Adds a list of users to a specified group. Specify users by user_psk. | | :param group_psk: Unique ID assigned by EASE to the group. | :param user_list: Comma-separated list of the user_psks for the users you want to add to the group. | :return: Dict of lists. Dict keys are: users_failed, users_added | | group_delete(self, group_psk) | Permanently deletes a group from the authenticated user’s organization. | | :param group_psk: Unique ID assigned by EASE to the group. | :result: Dict with deleted groups metadata. Dict keys are: psk, name, description | | group_delete_apps(self, group_psk, app_list) | Removes applications from a group. Specify apps by app_psk | | :param group_psk: Unique ID assigned by EASE to the group. | :param app_list: Comma-separated list of the app_psks for the applications you want to remove from the group. | :return: Dict of lists. Dict keys are: apps_removed, apps_failed | | group_list(self) | list of all the groups for the authenticated user’s organization. This list includes the number of users | and number of applications belonging to each group. | | :return: List of dicts of the groups. Dict keys are: app_count, psk, user_count, name, description | | https://apidocs.apperian.com/v1/groups.html | | group_list_apps(self, group_psk) | Returns a list of the applications that are in the specified group. | | :param group_psk: Unique ID assigned by EASE to the group. | :return: List of dicts. See API docs for dict keys | | https://apidocs.apperian.com/v1/groups.html | | group_list_members(self, group_psk) | Lists users who are members of a specified group. | | :param group_psk: Unique ID assigned by EASE to the group. | :return: List of Dicts. See API docs for dict keys | | https://apidocs.apperian.com/v1/groups.html | | group_remove_members(self, group_psk, user_list) | Removes applications from a group. Specify apps by app_psk | | :param group_psk: Unique ID assigned by EASE to the group. | :param user_list: Comma-separated list of the app_psks for the applications you want to remove from the group. | :return: Dict of lists. Dict keys are: users_failed, users_removed | | group_update(self, group_psk, data) | Updates data for an existing group in the authenticated user's organization. | | :param group_psk: Unique ID assigned by EASE to the group. | :param data: Dict of group metadata to change. Required keys: group_name, group_description | :return: Dict with updated metadata. Dict keys are: psk, name, description | | org_delete(self, psk) | :param psk: psk of the organization to be deleted | :return: returns "ok", "auth", or the error message | | set_default_region(self) | Allows you to change the default region this module uses without having to manually edit endpoints.json | If you have never run this function the default region will be North America | | set_region(self, region='default') | Change the region you access for this session and authenticates you to the new environment. | If 'list' is provided as the value for region you will see a list of options to manually choose from. | | :param region: Optional. Provide alternate region string. Use region='list' to manually select one | | user_add(self, data) | Must be authenticated as an EASE admin. Adds a new user to the EASE organization of the authenticated user. | | :param data: a dict of the user details you want to add. | :return: A successful response provides a unique key (user_psk) for the user. | | user_delete(self, psk) | Deletes a user from your EASE organization. A deleted user can no longer access the App Catalog or the EASE | Portal. If a deleted user tries to log in, the user will see a message that advises the user to contact support. | | :param psk: psk of the user to be deleted | :return: returns "ok", "auth", or the error message | | user_list(self, psk) | Returns information stored in the database about a user, such as user ID, email, phone number, | and the date when the user was created. | | :param psk: Unique ID assigned to the user you want to look up | :return: Returns a dict with the target user's details | | user_list_all(self) | Lists user details for every user in the org you are authenticated to. must be admin user to run | | :return: Returns a list of dicts. Dict keys are: psk, first_name, last_name, modified_date, deleted, email, | mobile_phone, role, created_date, until_date, disabled_reason, id, last_login_from_catalog | | user_update(self, psk, payload) | Updates the following data attributes for a user in your EASE organization: email, password, first_name, | last_name, phone. | | When you request this resource, you will need to provide the user_psk value assigned when you added the user. | | :param psk: Unique ID assigned to the user by EASE. | :param payload: a dict with the following keys: email, password, first_name, last_name, phone | :return: Dict with status and result of True/False
class Publish
| Methods defined here:
|
| __init__(self, user, pw, region='default')
|
| add_new_app(self, file_name, metadata)
| Adds a new app to your EASE instance under the category "Company Wide".
| Uses the functions create, upload, and publish
|
| :param file_name: name of the file you will be uploading. Can be a relative or absolute path
| :param metadata: Dict of the metadata needed to publish to ease. See API docs for dict keys
|
| :return:
|
| https://help.apperian.com/display/pub/apps.publish
|
| auth(self, user=None, password=None)
| :param user: Admin username
| :param password: Admin password
| :return: Boolean
|
| create(self)
| Creates an entry in EASE for the publishing API to upload a file to.
| Uses a token from the auth function
| :return: Returns transaction ID
|
| get_credentials(self)
| Lists all stored signing credentials for authenticated user's account
|
| :return: List of dicts with needed credential info. Each stored credential gets its own dict
|
| get_list(self)
| Lists all of the native apps in the organization you are authenticated to. Does not include webapps, or public
| app store links
|
| :return: List of dicts of app metadata. Dict keys are: ID, author, bundleID, longdescription, shortdescription,
| status, type, version, versionNotes
|
| publish(self, metadata, data)
| :param data: Dict of the metadata that is required to upload to ease.
|
| set_region(self, region='default')
| Change the region you access for this session and authenticates you to the new environment.
| If 'list' is provided as the value for region you will see a list of options to manually choose from.
|
| :param region: Optional. Provide alternate region string. Use region='list' to manually select one
|
| sign_application(self, app_psk, credentials_psk)
| Signs an app with the specified stored credential
|
| :param app_psk: Unique ID of app in ease. Can be found using list_apps()
| :param credentials_psk: Unique ID of the credentials to be used. Can be found via get_credentials()
| :return:
|
| update(self, app_id)
|
| upload(self, data)
| :param data: Dict with the file anme and transaction ID. Dict keys are: file_name, trans_id
| :return: returns fileID for the publish step
FUNCTIONS region_options(data)
response_check(r, *args)
DATA ENDPOINTS = {u'att': {u'Custom HTML5 App Catalogs': u'https://*.appcat... author = 'Shawn Roche'
AUTHOR Shawn Roche