Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
use new shiny API name, quickstart with task-library
Browse files Browse the repository at this point in the history
  • Loading branch information
zehicle committed Jan 24, 2019
1 parent 884db77 commit 27622f7
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 32 deletions.
22 changes: 11 additions & 11 deletions doc/faq-troubleshooting.rst
Expand Up @@ -272,31 +272,31 @@ Of course, you can apply a Param to a Profile, and apply that Profile to a group

.. _rs_download_rackn_content:

Download RackN Content via Command Line
---------------------------------------
Download Content and Plugins via Command Line
---------------------------------------------

If you need to download RackN content requiring authentication, you can do this via the command line by adding Auth Token to the download URL. Your Auth Token is your RackN UserID (UUID) found after logging in to the `RackN Portal User Management panel <https://portal.rackn.io/#/user/>`_.
RackN maintains a catalog of open and proprietary Digital Rebar extensions at ``https://api.rackn.io/catalog``. In both examples, providing ``?version=[version]`` on the query path will specify a version. No version gives ``stable``.

Here is an example download using our Auth Token, and using the Catalog to locate the correct download URL based on our DRP Endpoint OS and Architecture:
Content downloads directly from the Catalog as JSON and can be imported directly using the DRP CLI.
::
drpcli contents upload https://api.rackn.io/catalog/content/task-library?version=tip

# Set our RACKN_AUTH token to our UUID
export RACKN_AUTH="?username=<rackn_username_uuid>"
Plugin downloads require two steps. First, use the Catalog to locate the correct download URL based on our DRP Endpoint OS and Architecture. Second, request the plugin binary from the given URL.
::

# set our DRP OS and ARCH type
export DRP_ARCH="amd64"
export DRP_OS="linux"

# set our catalog location
PACKET_URL="https://qww9e4paf1.execute-api.us-west-2.amazonaws.com/main/catalog/plugins/packet-ipmi${RACKN_AUTH}"
URL="https://api.rackn.io/catalog/plugins/ipmi"

# obtain our parts for the final plugin download
PART=`curl -sfSL $PACKET_URL | jq -r ".$DRP_ARCH.$DRP_OS"`
BASE=`curl -sfSL $PACKET_URL | jq -r '.base'`
PART=`curl -sfSL $URL | jq -r ".$DRP_ARCH.$DRP_OS"`
BASE=`curl -sfSL $URL | jq -r '.base'`

# download the plugin - AWS cares about extra slashes ... blech
curl -s ${BASE}${PART}${RACKN_AUTH} -o drp-plugin-packet-ipmi

curl -s ${BASE}${PART} -o drp-plugin-ipmi

.. _rs_update_content_command_line:

Expand Down
9 changes: 4 additions & 5 deletions doc/upgrade.rst
Expand Up @@ -316,8 +316,7 @@ Please read the steps through carefully, and make note of the current contents/p

# go to RackN UX - log in, go to Hamburger menu (upper left, 3 horizontal lines)
# go to Organization - User Profile - copy your UUID for Unique User Identity
export RACKN_AUTH="?username=<UUID_Unique_User_Identity>"
export CATALOG="https://qww9e4paf1.execute-api.us-west-2.amazonaws.com/main/catalog"
export CATALOG="https://api.rackn.io/catalog"

# get raw output of just the content packs
for CONTENT in `drpcli contents list | jq -r '.[].meta.Name' | egrep -v "BackingStore|BasicStore"`
Expand All @@ -330,7 +329,7 @@ Please read the steps through carefully, and make note of the current contents/p
for CONTENT in drp-community-content task-library drp-community-contrib
do
echo "install content: $CONTENT"
curl -s $CATALOG/content/${CONTENT}${RACKN_AUTH} -o $CONTENT.json
curl -s $CATALOG/content/${CONTENT} -o $CONTENT.json
drpcli contents create -< $CONTENT.json
done

Expand All @@ -339,15 +338,15 @@ Please read the steps through carefully, and make note of the current contents/p
for PLUGIN in plug1 plug2 plug3
do
echo "install plugin: $PLUGIN"
curl -s $CATALOG/plugin/${PLUGIN}${RACKN_AUTH} -o $PLUGIN.json
curl -s $CATALOG/plugin/${PLUGIN} -o $PLUGIN.json
drpcli contents create -< $PLUGIN.json
done

# Ensure the Stage, Default, and Unknown BootEnv are set to valid values
# adjust these as appropriate
drpcli prefs set defaultStage discover defaultBootEnv sledgehammer unknownBootEnv discovery

Again - make sure you modify things appropriately in the above scriptlet. YOU MUST MODIFY THE *RACK_AUTH* variable appropriately for the download authentication to work correctly.
Again - make sure you modify things appropriately in the above scriptlet.

v3.2.0 to v3.3.0
----------------
Expand Down
26 changes: 11 additions & 15 deletions examples/pkt-demo/bin/control.sh
Expand Up @@ -39,8 +39,6 @@ then
&& xiterr 1 "API_KEY is empty or unset ... check 'secrets' file"
[[ -z "$PROJECT_ID" || "$PROJECT_ID" == "insert_project_id_here" ]] \
&& xiterr 1 "PROJECT_ID is empty or unset ... check 'secrets' file"
[[ -z "$RACKN_USERNAME" || "$RACKN_USERNAME" == "insert_rackn_username_here" ]] \
&& xiterr 1 "RACKN_USERNAME is empty or unset ... check 'secrets' file"
fi

# get our OS info of this platform
Expand All @@ -50,8 +48,6 @@ case $_arch in
x86_64) _arch="amd64" ;;
esac

RACKN_AUTH="?username=${RACKN_USENAME}"

API="insert_api_key_here"
PROJECT="insert_project_id_here"
USERNAME="insert_rackn_username_here"
Expand Down Expand Up @@ -329,10 +325,10 @@ case $1 in

# community contents
$CURL \
https://qww9e4paf1.execute-api.us-west-2.amazonaws.com/main/catalog/content/task-library${RACKN_AUTH} \
https://api.rackn.io/catalog/content/task-library \
-o task-library-content.yaml
# $CURL \
# https://qww9e4paf1.execute-api.us-west-2.amazonaws.com/main/catalog/content/task-library.sha256${RACKN_AUTH} \
# https://api.rackn.io/catalog/content/task-library.sha256 \
# -o task-library-content.sha256
# sed -i 's/ \(task-library\)\(.yaml\)$/ \1-content\2/' task-library-content.sha256
#
Expand All @@ -354,7 +350,7 @@ case $1 in
cd dr-provision-install

# get our packet-ipmi provider plugin location
PACKET_URL="https://qww9e4paf1.execute-api.us-west-2.amazonaws.com/main/catalog/plugins/packet-ipmi${RACKN_AUTH}"
PACKET_URL="https://api.rackn.io/catalog/plugins/packet-ipmi"
PART=`$CURL $PACKET_URL | jq -r ".$DRP_ARCH.$DRP_OS"`
BASE=`$CURL $PACKET_URL | jq -r '.base'`
# download the plugin - AWS cares about extra slashes ... blech
Expand All @@ -374,17 +370,17 @@ case $1 in

# packet helper content
$CURL \
https://qww9e4paf1.execute-api.us-west-2.amazonaws.com/main/catalog/content/packet${RACKN_AUTH} \
https://api.rackn.io/catalog/content/packet \
-o drp-content-packet.json
ls -l drp-content-packet.json

$CURL \
https://qww9e4paf1.execute-api.us-west-2.amazonaws.com/main/catalog/plugins/packet-ipmi${RACKN_AUTH} \
https://api.rackn.io/catalog/plugins/packet-ipmi \
-o drp-plugin-packet-ipmi.json
ls -l drp-plugin-packet-ipmi.json

# get our packet-ipmi provider plugin location
PACKET_URL="https://qww9e4paf1.execute-api.us-west-2.amazonaws.com/main/catalog/plugins/packet-ipmi${RACKN_AUTH}"
PACKET_URL="https://api.rackn.io/catalog/plugins/packet-ipmi"
PART=`$CURL $PACKET_URL | jq -r ".$DRP_ARCH.$DRP_OS"`
BASE=`$CURL $PACKET_URL | jq -r '.base'`
# download the plugin - AWS cares about extra slashes ... blech
Expand Down Expand Up @@ -451,7 +447,7 @@ case $1 in
# where drp-setup will pick it up and install it for us
get-drp-krib-content)

curl -s https://qww9e4paf1.execute-api.us-west-2.amazonaws.com/main/catalog/content/krib${RACKN_AUTH} \
curl -s https://api.rackn.io/catalog/content/krib \
-o dr-provision-install/drp-krib-content.json
;;

Expand Down Expand Up @@ -529,7 +525,7 @@ case $1 in
# intended to be run on remote DRP endpoint
fix-stages-bug)

URL="https://qww9e4paf1.execute-api.us-west-2.amazonaws.com/main/catalog/content/packet${RACKN_AUTH}"
URL="https://api.rackn.io/catalog/content/packet"
CONTENT="dr-provision-install/drp-content-packet.json"
CONTENT_NAME=`cat $CONTENT | jq -r '.meta.Name'`
set -x
Expand All @@ -550,10 +546,10 @@ case $1 in

# get content
# content/packet is separate out to drp-content-packet in get-plugins (json and plugin both)
# https://qww9e4paf1.execute-api.us-west-2.amazonaws.com/main/catalog/content/packet${RACKN_AUTH}
# https://api.rackn.io/catalog/content/packet
URLS="
https://qww9e4paf1.execute-api.us-west-2.amazonaws.com/main/catalog/content/os-linux${RACKN_AUTH}
https://qww9e4paf1.execute-api.us-west-2.amazonaws.com/main/catalog/content/os-discovery${RACKN_AUTH}
https://api.rackn.io/catalog/content/os-linux
https://api.rackn.io/catalog/content/os-discovery
"
for URL in $URLS
do
Expand Down
4 changes: 3 additions & 1 deletion tools/install.sh
Expand Up @@ -545,8 +545,10 @@ case $MODE in
echo "# Once dr-provision is started, setup a base discovery configuration"
echo " ${EP}drpcli bootenvs uploadiso sledgehammer"
echo " ${EP}drpcli prefs set defaultWorkflow discover-base unknownBootEnv discovery defaultBootEnv sledgehammer defaultStage discover"
echo "# Add common utilities (sourced from RackN)"
echo " ${EP}drpcli contents upload https://api.rackn.io/catalog/content/task-library"
echo
echo "# Optionally, install the isos for common community operating systems"
echo "# Optionally, locally cache the isos for common community operating systems"
echo " ${EP}drpcli bootenvs uploadiso ubuntu-18.04-install"
echo " ${EP}drpcli bootenvs uploadiso centos-7-install"
echo
Expand Down

0 comments on commit 27622f7

Please sign in to comment.