This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$RoleArn = "%deployer_arn%" | |
$ExternalId = "%assume_role_external_id%" | |
$Region = "us-east-1" | |
$Response = (Use-STSRole -Region $Region -RoleArn $RoleArn -ExternalId $ExternalId -RoleSessionName "deploy-website-s3-bucket").Credentials | |
$SecretAccessKey = $Response.SecretAccessKey | |
$SessionToken = $Response.SessionToken |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_orgunits_properties(uc,org_unit_type_id=None,org_unit_code=None,org_unit_name=None,bookmark=None,ver='1.3',**kwargs): | |
""" | |
Custom method hitting Brightspace Valence API. Request to add to service.py in d2lvalence_util submitted; consider removal. | |
""" | |
route = '/d2l/api/lp/{0}/orgstructure/'.format(ver) | |
kwargs.setdefault('params', {}) | |
if org_unit_type_id: | |
kwargs['params'].update({'orgUnitType': org_unit_type_id}) | |
if org_unit_code: | |
kwargs['params'].update({'orgUnitCode': org_unit_code}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _make_pf_request(environment, client_id, client_secret, grant_type, service_endpoint, post_data): | |
logger.debug("client_id: {0}".format(client_id)) | |
logger.debug("client_secret: {0}".format(client_secret)) | |
logger.debug("grant_type: {0}".format(grant_type)) | |
logger.debug("service_endpoint: {0}".format(service_endpoint)) | |
logger.debug("post_data: {0}".format(post_data)) | |
auth_info = "{0}:{1}".format(client_id, client_secret) | |
logger.debug("auth_info: {0}".format(auth_info)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_palindrome(w): | |
word_length = len(w) | |
if word_length == 1: | |
return True | |
elif word_length == 2: | |
return w[0] == w[1] | |
else: | |
return w[0] == w[word_length-1] and is_palindrome(w[1:word_length-1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import requests | |
import EnvironmentSetting | |
from khelib import AppSettings | |
import d2lvalence.auth as d2lauth | |
import d2lvalence_util.service as d2lservice | |
import d2lvalence_util.data as d2ldata | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NOTE: if the content all have the same id (e.g. if they actually are underlying in the same data table) | |
- applying filters, schedules, etc. is much easier. | |
Features: | |
1. Application (Client - choose a noun): | |
GET /client(?name=xxx) - retrieve a list of clients | |
- GET /client/{client-id} - retrieve specific client (vs QS version... ) | |
POST /client - create a new client application | |
PUT /client/{client-id} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swagger: '2.0' | |
info: | |
title: Kaplan CMS Admin API | |
description: | | |
This API enables client applications to administer CMS content in a headless manner. | |
## Features | |
1. Clients can modify CMS content including: assets, content blocks, pages, and page templates. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Retrieve & Decrypt settings from DDB. | |
Sample Usage: | |
foo=$(python settings.py decrypt <my-app> <my-config-value-name>) | |
echo $foo | |
foo=$(python settings.py settings <my-app>) | |
echo $foo | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch .vscode/launch.json' --prune-empty --tag-name-filter cat -- --all | |
git update-index --assume-unchanged FILENAME_TO_IGNORE |