From e605dba76b0132c87c13c092c69506d33e7820f3 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Thu, 1 Jul 2021 01:49:47 -0400 Subject: [PATCH] Update package name from webqueue2-api to webqueue2api and replace 0.9.1 reference with 1.0.0 --- docs-src/Installation.md | 10 +++++----- docs/Installation/index.html | 10 +++++----- docs/search/search_index.json | 2 +- docs/sitemap.xml.gz | Bin 367 -> 367 bytes setup.py | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs-src/Installation.md b/docs-src/Installation.md index ece9100..bd8fa0f 100644 --- a/docs-src/Installation.md +++ b/docs-src/Installation.md @@ -28,21 +28,21 @@ The code is available on [GitHub]({{ config.repo_url }}). Available package vers ``` === "Install via pip" - To install webqueue2-api 0.9.1, you can run: + To install webqueue2-api 1.0.0, you can run: ``` - pip install git+{{ config.repo_url }}@0.9.1#egg=webqueue2-api + pip install git+{{ config.repo_url }}@1.0.0#egg=webqueue2api ``` === "Install via requirements file" - To install webqueue2-api 0.9.1, place the following line your requirements file: + To install webqueue2-api 1.0.0, place the following line your requirements file: ```bash - echo "git+{{ config.repo_url }}@0.9.1#egg=webqueue2-api" >> requirements.txt + echo "git+{{ config.repo_url }}@1.0.0#egg=webqueue2api" >> requirements.txt pip install -r requirements.txt ``` -If you'd like a version other than 0.9.1 simply replace the that version number with a different version listed on the [releases page]({{ config.repo_url }}/releases). +If you'd like a version other than 1.0.0 simply replace the that version number with a different version listed on the [releases page]({{ config.repo_url }}/releases). To start the server, run the following while your virtual environment is activated: ```bash diff --git a/docs/Installation/index.html b/docs/Installation/index.html index 2fc2b6a..e60f14b 100644 --- a/docs/Installation/index.html +++ b/docs/Installation/index.html @@ -440,18 +440,18 @@

Installation

-

To install webqueue2-api 0.9.1, you can run:

-
pip install git+https://github.itap.purdue.edu/ECN/webqueue2-api@0.9.1#egg=webqueue2-api
+

To install webqueue2-api 1.0.0, you can run:

+
pip install git+https://github.itap.purdue.edu/ECN/webqueue2-api@1.0.0#egg=webqueue2api
 
-

To install webqueue2-api 0.9.1, place the following line your requirements file:

-
echo "git+https://github.itap.purdue.edu/ECN/webqueue2-api@0.9.1#egg=webqueue2-api" >> requirements.txt
+

To install webqueue2-api 1.0.0, place the following line your requirements file:

+
echo "git+https://github.itap.purdue.edu/ECN/webqueue2-api@1.0.0#egg=webqueue2api" >> requirements.txt
 pip install -r requirements.txt
 
-

If you'd like a version other than 0.9.1 simply replace the that version number with a different version listed on the releases page.

+

If you'd like a version other than 1.0.0 simply replace the that version number with a different version listed on the releases page.

To start the server, run the following while your virtual environment is activated:

gunicorn webqueue2api.api:app
 

diff --git a/docs/search/search_index.json b/docs/search/search_index.json index abb1add..75f8032 100644 --- a/docs/search/search_index.json +++ b/docs/search/search_index.json @@ -1 +1 @@ -{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"See the API Docs . See the Python Package Docs","title":"Home"},{"location":"Dev%20Environment%20Setup%20Guide/","text":"Dev Environment Setup Guide \u2693\ufe0e This document will walk you through the setup and configuration of a development environment for webqueue2 using the provided development machines, SSH authentication, GitHub and VS Code. Prerequisites \u2693\ufe0e On Your Computer \u2693\ufe0e VS Code Cisco AnyConnect for WebVPN On The Development Computer \u2693\ufe0e Note These are already installed on the provided development machines. git Python >= 3.6.9 Configuring Your SSH Keys \u2693\ufe0e We will be using SSH keys to authenticate to both the development machines and GitHub. In either PowerShell on Windows or bash on macOS/Linux, run the following command and accept all defaults by pressing Enter : ssh-keygen This will create the files id_rsa and id_rsa.pub in the .ssh folder inside your user's folder. Your user's folder can usually be found at: Windows C:\\Users\\ macOS /Users/ Linux /home/ Note Most CLI shells like PowerShell and bash use the ~ (tilda) key as a shortcut for your user's folder. You can confirm these files were created by running: ls ~/.ssh/ Configuring SSH \u2693\ufe0e In your editor of choice, create the file ~/.ssh/config and add this: Tip Replace campb303 with your career account username and replace w2vm1 with the name of the provided development machine you're connecting to. Host campb303-w2vm1 HostName w2vm1.ecn.purdue.edu User campb303 # Forward Flask Debug Port LocalForward 5000 localhost:5000 # Forward MkDocs Port LocalForward 5000 localhost:6060 # Forward gunicorn Port LocalForward 8000 localhost:8000 The configuration above will allow you to connect to the development machine and automatically forward ports for development tools to work. Here's a bit more detail about what's going on: Key Value Host A friendly name to identify an SSH host by. This can be anything. HostName The DNS name or IP address of the computer you're connecting to. User The name of your user on the computer you're connecting to. LocalForward Forwards a port on your computer to a port on the computer you're connecting to. Development machines are not publicly accessible. You'll need to be connected to WebVPN to connect to them. SSH Jump Hosts WebVPN works on all platforms but requires an extra step to get to work. On macOS/Linux, pier.ecn.purdue.edu can be used as an SSH jump host allowing for development machines to be connected to automatically when openning VS Code. Assuming you already have an SSH key configured for pier.ecn.purdue.edu , you can use a jump host by adding the following to ~/.ssh/config : Host campb303-pier HostName pier.ecn.purdue.edu User campb303 Host campb303-w2vm1 HostName w2vm1.ecn.purdue.edu ProxyJump campb303-pier User campb303 # Forward Flask Debug Port LocalForward 5000 localhost:5000 # Forward MkDocs Port LocalForward 5000 localhost:6060 # Forward gunicorn Port LocalForward 8000 localhost:8000 To test your configuration, run ssh followed by the Host value. When prompted for your password, enter your career account password and press Enter . Warning Most shell environemnts like PowerShell and bash do not show your password being typed but it is being typed. For the configuration above you would run: ssh campb303-w2vm1 campb303@w2vm1's password: Adding SSH Keys \u2693\ufe0e Now that we've generated SSH keys and configured our host entries, we need to add our SSH key to the host. This will allow us to connect to these machines without passwords later. Tip Replace HOST below with the value from above. Example: campb303-w2vm1 PowerShell on Windows type $env:USERPROFILE \\. ssh \\ id_rsa . pub | ssh HOST \"cat >> .ssh/authorized_keys\" bash on macOS/Linux ssh-copy-id HOST If the key was added successfully, you can login without entering a password by running: ssh HOST Installing VS Code \u2693\ufe0e Download and install VS Code . Be sure to add code to your PATH. Windows Adding code to your PATH on Windows is a checkbox in the installer: Image from this article on Techomoro macOS/Linux Adding code to your PATH on macOS/Linux is accessible by searching for \"PATH\" in the Command Pallete. You can access the Command Pallete with the keyboard shortcut Command / Ctrl + Shift + P : Image from this StackOverflow thread Connecting To The Development Machine \u2693\ufe0e Install the Remote - SSH plugin. After installation a new icon will appear in the sidebar: Click on the Remote SSH icon and you'll see the SSH host you just defined Select the host and click the New Window icon to connect. A new window connected to that host will appear Note This may take a couple of minutes on the first connection while VS Code installs its server. If prompted for a platform, select Linux: Adding Your SSH Keys to GitHub \u2693\ufe0e Because the development machine will be the computer that connects to GitHub, we need to create another SSH key and add it to our GitHub profile: First, open VS Code's integrated terminal by pressing Control + ~ (tilda) Now run the following command and accept all defaults by pressing Enter : ssh-keygen This will create the files id_rsa and id_rsa.pub in ~/.ssh/ . You can confirm this by running: ls ~/.ssh/ Now copy the public key from id_rsa.pub by openning the file in VS Code, selecting its contents and copying it. You can open the file in VS Code by running the following in the integrated terminal: Danger Do not copy your private key from id_rsa ! This key should never leave your machine. code ~/.ssh/id_rsa.pub Now go to github.itap.purdue.edu/settings/keys . You may be prompted to login using your career account username and password. Click the \"New SSH Key\" button Give the key a title that tells you what device the key is from (e.g. Desktop or Dev Machine) Paste the contents of id_rsa.pub into the key box Click the \"Add SSH Key\" button Cloning and Opening the Repository \u2693\ufe0e Using the integrated terminal in VS Code, run: git clone git@github.itap.purdue.edu:ECN/webqueue2-api.git This will create a webqueue2-api folder in your user's home directory. Open this directory using the \"Open Folder\" button: Note VS Code will automatically reconnect to the last remote host used when it reopens. Tip If you need to reconnect manually, there will now be an option to open the webqueue2-api folder directly from the Remote Hosts menu: Configuring VS Code \u2693\ufe0e Installing Extensions \u2693\ufe0e Pylance for Python language support, IntelliSense, virtual environments and debugging Git Graph for a more detailed view of git info Markdown Preview GitHub Styling for previewing Markdown as it will appear on GitHub Python Docstring Generator for generating Google style docstrings according to section 3.8 of Google's Python style guide Configuring Extensions \u2693\ufe0e Python \u2693\ufe0e The Python extension supports virtual environments but needs to be told where the virtual environment is. Create or modify the file .vscode/settings.json and add the following: \"python.defaultInterpreterPath\": \"./venv/bin/python3\" Tip The Python extension may complain and tell you to select another interpreter. Ignore this warning for now. Python Docstring Generator \u2693\ufe0e For consistentcy, we'll use a docstring template. Create or modify the file .vscode/settings.json and add the following: \"autoDocstring.customTemplatePath\": \"./docstring-format.mustache\" At this point, your .vscode/settings.json file should look like this: { \"python.pythonPath\": \"./venv/bin/python3\", \"autoDocstring.customTemplatePath\": \"./docstring-format.mustache\" } Setting Up the Virtual Environment \u2693\ufe0e For development, we'll use a Python Virtual Environment to isolate out changes and have a reproducible dev environment. In VS Code's integrated terminal: Create a virtual environment at ./venv/ : python3 -m venv venv Activate the virtual environment: source venv/bin/activate Tip To deactivate the virtual environment and use your system's Python interpreter, run: deactivate Update pip within the virtual environment: pip install -U pip Install the webqueue2 API within the virtual environemt: pip install -e .[all] -e installs a package in editable mode which allows code changes to take effect without reinstalling a package. webqueue2 API has multiple conditional dependencies : Condition Installation Command Description Production pip install . For use in production. Only installed needed packages. Development pip install .[dev] For use in development. Installs everything for production and extra packages for development. Documentation pip install .[docs] For use in creating documentation. Installs everything for production and extra packages for documentation. All pip install .[all] A shortcut for installing production, development and documentation dependencies. API Commands \u2693\ufe0e Command Description gunicorn webqueue2api.api:app This will start a local server on localhost:8000 to access the API. mkdocs serve This will start a local server on localhost:6060 to access the API docs. As you change API documentation files in ./docs/ you'll see your changes in the browser. mkdocs build This will output a static bundle of the API documentation in ./site/ that can be put on any webserver.","title":"Dev Environment Setup Guide"},{"location":"Dev%20Environment%20Setup%20Guide/#dev-environment-setup-guide","text":"This document will walk you through the setup and configuration of a development environment for webqueue2 using the provided development machines, SSH authentication, GitHub and VS Code.","title":"Dev Environment Setup Guide"},{"location":"Dev%20Environment%20Setup%20Guide/#prerequisites","text":"","title":"Prerequisites"},{"location":"Dev%20Environment%20Setup%20Guide/#on-your-computer","text":"VS Code Cisco AnyConnect for WebVPN","title":"On Your Computer"},{"location":"Dev%20Environment%20Setup%20Guide/#on-the-development-computer","text":"Note These are already installed on the provided development machines. git Python >= 3.6.9","title":"On The Development Computer"},{"location":"Dev%20Environment%20Setup%20Guide/#configuring-your-ssh-keys","text":"We will be using SSH keys to authenticate to both the development machines and GitHub. In either PowerShell on Windows or bash on macOS/Linux, run the following command and accept all defaults by pressing Enter : ssh-keygen This will create the files id_rsa and id_rsa.pub in the .ssh folder inside your user's folder. Your user's folder can usually be found at: Windows C:\\Users\\ macOS /Users/ Linux /home/ Note Most CLI shells like PowerShell and bash use the ~ (tilda) key as a shortcut for your user's folder. You can confirm these files were created by running: ls ~/.ssh/","title":"Configuring Your SSH Keys"},{"location":"Dev%20Environment%20Setup%20Guide/#configuring-ssh","text":"In your editor of choice, create the file ~/.ssh/config and add this: Tip Replace campb303 with your career account username and replace w2vm1 with the name of the provided development machine you're connecting to. Host campb303-w2vm1 HostName w2vm1.ecn.purdue.edu User campb303 # Forward Flask Debug Port LocalForward 5000 localhost:5000 # Forward MkDocs Port LocalForward 5000 localhost:6060 # Forward gunicorn Port LocalForward 8000 localhost:8000 The configuration above will allow you to connect to the development machine and automatically forward ports for development tools to work. Here's a bit more detail about what's going on: Key Value Host A friendly name to identify an SSH host by. This can be anything. HostName The DNS name or IP address of the computer you're connecting to. User The name of your user on the computer you're connecting to. LocalForward Forwards a port on your computer to a port on the computer you're connecting to. Development machines are not publicly accessible. You'll need to be connected to WebVPN to connect to them. SSH Jump Hosts WebVPN works on all platforms but requires an extra step to get to work. On macOS/Linux, pier.ecn.purdue.edu can be used as an SSH jump host allowing for development machines to be connected to automatically when openning VS Code. Assuming you already have an SSH key configured for pier.ecn.purdue.edu , you can use a jump host by adding the following to ~/.ssh/config : Host campb303-pier HostName pier.ecn.purdue.edu User campb303 Host campb303-w2vm1 HostName w2vm1.ecn.purdue.edu ProxyJump campb303-pier User campb303 # Forward Flask Debug Port LocalForward 5000 localhost:5000 # Forward MkDocs Port LocalForward 5000 localhost:6060 # Forward gunicorn Port LocalForward 8000 localhost:8000 To test your configuration, run ssh followed by the Host value. When prompted for your password, enter your career account password and press Enter . Warning Most shell environemnts like PowerShell and bash do not show your password being typed but it is being typed. For the configuration above you would run: ssh campb303-w2vm1 campb303@w2vm1's password:","title":"Configuring SSH"},{"location":"Dev%20Environment%20Setup%20Guide/#adding-ssh-keys","text":"Now that we've generated SSH keys and configured our host entries, we need to add our SSH key to the host. This will allow us to connect to these machines without passwords later. Tip Replace HOST below with the value from above. Example: campb303-w2vm1 PowerShell on Windows type $env:USERPROFILE \\. ssh \\ id_rsa . pub | ssh HOST \"cat >> .ssh/authorized_keys\" bash on macOS/Linux ssh-copy-id HOST If the key was added successfully, you can login without entering a password by running: ssh HOST","title":"Adding SSH Keys"},{"location":"Dev%20Environment%20Setup%20Guide/#installing-vs-code","text":"Download and install VS Code . Be sure to add code to your PATH. Windows Adding code to your PATH on Windows is a checkbox in the installer: Image from this article on Techomoro macOS/Linux Adding code to your PATH on macOS/Linux is accessible by searching for \"PATH\" in the Command Pallete. You can access the Command Pallete with the keyboard shortcut Command / Ctrl + Shift + P : Image from this StackOverflow thread","title":"Installing VS Code"},{"location":"Dev%20Environment%20Setup%20Guide/#connecting-to-the-development-machine","text":"Install the Remote - SSH plugin. After installation a new icon will appear in the sidebar: Click on the Remote SSH icon and you'll see the SSH host you just defined Select the host and click the New Window icon to connect. A new window connected to that host will appear Note This may take a couple of minutes on the first connection while VS Code installs its server. If prompted for a platform, select Linux:","title":"Connecting To The Development Machine"},{"location":"Dev%20Environment%20Setup%20Guide/#adding-your-ssh-keys-to-github","text":"Because the development machine will be the computer that connects to GitHub, we need to create another SSH key and add it to our GitHub profile: First, open VS Code's integrated terminal by pressing Control + ~ (tilda) Now run the following command and accept all defaults by pressing Enter : ssh-keygen This will create the files id_rsa and id_rsa.pub in ~/.ssh/ . You can confirm this by running: ls ~/.ssh/ Now copy the public key from id_rsa.pub by openning the file in VS Code, selecting its contents and copying it. You can open the file in VS Code by running the following in the integrated terminal: Danger Do not copy your private key from id_rsa ! This key should never leave your machine. code ~/.ssh/id_rsa.pub Now go to github.itap.purdue.edu/settings/keys . You may be prompted to login using your career account username and password. Click the \"New SSH Key\" button Give the key a title that tells you what device the key is from (e.g. Desktop or Dev Machine) Paste the contents of id_rsa.pub into the key box Click the \"Add SSH Key\" button","title":"Adding Your SSH Keys to GitHub"},{"location":"Dev%20Environment%20Setup%20Guide/#cloning-and-opening-the-repository","text":"Using the integrated terminal in VS Code, run: git clone git@github.itap.purdue.edu:ECN/webqueue2-api.git This will create a webqueue2-api folder in your user's home directory. Open this directory using the \"Open Folder\" button: Note VS Code will automatically reconnect to the last remote host used when it reopens. Tip If you need to reconnect manually, there will now be an option to open the webqueue2-api folder directly from the Remote Hosts menu:","title":"Cloning and Opening the Repository"},{"location":"Dev%20Environment%20Setup%20Guide/#configuring-vs-code","text":"","title":"Configuring VS Code"},{"location":"Dev%20Environment%20Setup%20Guide/#installing-extensions","text":"Pylance for Python language support, IntelliSense, virtual environments and debugging Git Graph for a more detailed view of git info Markdown Preview GitHub Styling for previewing Markdown as it will appear on GitHub Python Docstring Generator for generating Google style docstrings according to section 3.8 of Google's Python style guide","title":"Installing Extensions"},{"location":"Dev%20Environment%20Setup%20Guide/#configuring-extensions","text":"","title":"Configuring Extensions"},{"location":"Dev%20Environment%20Setup%20Guide/#python","text":"The Python extension supports virtual environments but needs to be told where the virtual environment is. Create or modify the file .vscode/settings.json and add the following: \"python.defaultInterpreterPath\": \"./venv/bin/python3\" Tip The Python extension may complain and tell you to select another interpreter. Ignore this warning for now.","title":"Python"},{"location":"Dev%20Environment%20Setup%20Guide/#python-docstring-generator","text":"For consistentcy, we'll use a docstring template. Create or modify the file .vscode/settings.json and add the following: \"autoDocstring.customTemplatePath\": \"./docstring-format.mustache\" At this point, your .vscode/settings.json file should look like this: { \"python.pythonPath\": \"./venv/bin/python3\", \"autoDocstring.customTemplatePath\": \"./docstring-format.mustache\" }","title":"Python Docstring Generator"},{"location":"Dev%20Environment%20Setup%20Guide/#setting-up-the-virtual-environment","text":"For development, we'll use a Python Virtual Environment to isolate out changes and have a reproducible dev environment. In VS Code's integrated terminal: Create a virtual environment at ./venv/ : python3 -m venv venv Activate the virtual environment: source venv/bin/activate Tip To deactivate the virtual environment and use your system's Python interpreter, run: deactivate Update pip within the virtual environment: pip install -U pip Install the webqueue2 API within the virtual environemt: pip install -e .[all] -e installs a package in editable mode which allows code changes to take effect without reinstalling a package. webqueue2 API has multiple conditional dependencies : Condition Installation Command Description Production pip install . For use in production. Only installed needed packages. Development pip install .[dev] For use in development. Installs everything for production and extra packages for development. Documentation pip install .[docs] For use in creating documentation. Installs everything for production and extra packages for documentation. All pip install .[all] A shortcut for installing production, development and documentation dependencies.","title":"Setting Up the Virtual Environment"},{"location":"Dev%20Environment%20Setup%20Guide/#api-commands","text":"Command Description gunicorn webqueue2api.api:app This will start a local server on localhost:8000 to access the API. mkdocs serve This will start a local server on localhost:6060 to access the API docs. As you change API documentation files in ./docs/ you'll see your changes in the browser. mkdocs build This will output a static bundle of the API documentation in ./site/ that can be put on any webserver.","title":"API Commands"},{"location":"Installation/","text":"Installation \u2693\ufe0e The webqueue2 API is publicly available at https://engineering.purdue.edu/webqueue/webqueue2/build/api but you can install it on your own machine if you'd like. The code is available on GitHub . Available package versions can be seen on the releases page and can be installed via pip, a requirements file, or downloaded and installed manually. pip available on ECN machines needs updated. Installation via pip is possible through pip's VCS support which was introduced in pip 19. The version of pip available on ECN supported machines is too old and needs updated. To update pip, run: pip install -U pop Using a virtual environment is recommended for reproducibility. Create a virtual environment called __venv__ : python3 -m venv __venv__ Activate the virtual environment: source __venv__/bin/activate Update pip: pip install -U pip Install via pip To install webqueue2-api 0.9.1, you can run: pip install git+https://github.itap.purdue.edu/ECN/webqueue2-api@0.9.1#egg=webqueue2-api Install via requirements file To install webqueue2-api 0.9.1, place the following line your requirements file: echo \"git+https://github.itap.purdue.edu/ECN/webqueue2-api@0.9.1#egg=webqueue2-api\" >> requirements.txt pip install -r requirements.txt If you'd like a version other than 0.9.1 simply replace the that version number with a different version listed on the releases page . To start the server, run the following while your virtual environment is activated: gunicorn webqueue2api.api:app","title":"Installation"},{"location":"Installation/#installation","text":"The webqueue2 API is publicly available at https://engineering.purdue.edu/webqueue/webqueue2/build/api but you can install it on your own machine if you'd like. The code is available on GitHub . Available package versions can be seen on the releases page and can be installed via pip, a requirements file, or downloaded and installed manually. pip available on ECN machines needs updated. Installation via pip is possible through pip's VCS support which was introduced in pip 19. The version of pip available on ECN supported machines is too old and needs updated. To update pip, run: pip install -U pop Using a virtual environment is recommended for reproducibility. Create a virtual environment called __venv__ : python3 -m venv __venv__ Activate the virtual environment: source __venv__/bin/activate Update pip: pip install -U pip Install via pip To install webqueue2-api 0.9.1, you can run: pip install git+https://github.itap.purdue.edu/ECN/webqueue2-api@0.9.1#egg=webqueue2-api Install via requirements file To install webqueue2-api 0.9.1, place the following line your requirements file: echo \"git+https://github.itap.purdue.edu/ECN/webqueue2-api@0.9.1#egg=webqueue2-api\" >> requirements.txt pip install -r requirements.txt If you'd like a version other than 0.9.1 simply replace the that version number with a different version listed on the releases page . To start the server, run the following while your virtual environment is activated: gunicorn webqueue2api.api:app","title":"Installation"},{"location":"Material%20for%20mkdocs%20Formatting/","text":"Material for mkdocs Formatting \u2693\ufe0e Admonitions \u2693\ufe0e See: Material for mkdocs: Admonitions Note Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa. Summary Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa. Info Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa. Custom Title Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa. Code Blocks \u2693\ufe0e See: Material for mkdocs: Code Blocks # This is a Python code block. print ( \"Hello world!\" ) if __name__ == \"__main__\" 1 2 # This is a JavaScript code block with line numbers . ( _ => console . log ( \"Hello world!\" ))(); # This is a Markdown code block with line highlights and nested code block. ``` js ( _ => console.log(\"Hello world!\"))(); ``` This is an inline Java highlight system . out . println ( \"Hello world!\" ) Content Tabs \u2693\ufe0e See: Material for mkdocs: Content Tabs Basic Tabs \u2693\ufe0e === \"Tab 1\" Hello === \"Tab 2\" World Tab 1 Hello Tab 2 World Tabs in Admonitions with Code Blocks \u2693\ufe0e !!! example \"Hello world\" in many languages: === \"Python\" ```python print ( \"Hello world!\" ) if __name__ == \"__main__\" ``` === \"JavaScript\" ```js ( _ => console . log ( \"Hello world!\" ))(); ``` Example \"Hello world\" in many languages: Python print ( \"Hello world!\" ) if __name__ == \"__main__\" JavaScript ( _ => console . log ( \"Hello world!\" ))(); Data Tables \u2693\ufe0e See: Material for mkdocs: Data Tables | Method | Description | | ----------- | ------------------------------------ | | `GET` | :material-check: Fetch resource | | `PUT` | :material-check-all: Update resource | | `DELETE` | :material-close: Delete resource | Method Description GET Fetch resource PUT Update resource DELETE Delete resource","title":"Material for mkdocs Formatting"},{"location":"Material%20for%20mkdocs%20Formatting/#material-for-mkdocs-formatting","text":"","title":"Material for mkdocs Formatting"},{"location":"Material%20for%20mkdocs%20Formatting/#admonitions","text":"See: Material for mkdocs: Admonitions Note Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa. Summary Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa. Info Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa. Custom Title Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.","title":"Admonitions"},{"location":"Material%20for%20mkdocs%20Formatting/#code-blocks","text":"See: Material for mkdocs: Code Blocks # This is a Python code block. print ( \"Hello world!\" ) if __name__ == \"__main__\" 1 2 # This is a JavaScript code block with line numbers . ( _ => console . log ( \"Hello world!\" ))(); # This is a Markdown code block with line highlights and nested code block. ``` js ( _ => console.log(\"Hello world!\"))(); ``` This is an inline Java highlight system . out . println ( \"Hello world!\" )","title":"Code Blocks"},{"location":"Material%20for%20mkdocs%20Formatting/#content-tabs","text":"See: Material for mkdocs: Content Tabs","title":"Content Tabs"},{"location":"Material%20for%20mkdocs%20Formatting/#basic-tabs","text":"=== \"Tab 1\" Hello === \"Tab 2\" World Tab 1 Hello Tab 2 World","title":"Basic Tabs"},{"location":"Material%20for%20mkdocs%20Formatting/#tabs-in-admonitions-with-code-blocks","text":"!!! example \"Hello world\" in many languages: === \"Python\" ```python print ( \"Hello world!\" ) if __name__ == \"__main__\" ``` === \"JavaScript\" ```js ( _ => console . log ( \"Hello world!\" ))(); ``` Example \"Hello world\" in many languages: Python print ( \"Hello world!\" ) if __name__ == \"__main__\" JavaScript ( _ => console . log ( \"Hello world!\" ))();","title":"Tabs in Admonitions with Code Blocks"},{"location":"Material%20for%20mkdocs%20Formatting/#data-tables","text":"See: Material for mkdocs: Data Tables | Method | Description | | ----------- | ------------------------------------ | | `GET` | :material-check: Fetch resource | | `PUT` | :material-check-all: Update resource | | `DELETE` | :material-close: Delete resource | Method Description GET Fetch resource PUT Update resource DELETE Delete resource","title":"Data Tables"},{"location":"api/Authentication/","text":"Authentication \u2693\ufe0e The webqueue2 API uses a two stage authentication system combining Active Directory and HTTP Token (or \"bearer\") authentication. Getting an Access Token \u2693\ufe0e All API calls require an access token. You can get an access token by making a POST request to the /api/login endpoint containing the JSON encoded username and password of a valid user. Who is a valid user? A valid user is a non-admin BoilerAD user who is in the 00000227-ECN-webqueue group. Users cannot be added directly to this group. To be included in this group, a user must exist in one of the following groups: 00000227-ECNStaff 00000227-ECNStuds 00000227-ECN-webqueue-misc Example \u2693\ufe0e Get an access token. fetch ( \"https://engineering.purdue.edu/webqueue/webqueue2/build/api/login\" , { method : \"POST\" , headers : { 'Content-Type' : 'application/json' }, body : JSON . stringify ({ \"username\" : USERNAME , \"password\" : PASSWORD }) } ) . then ( resp => resp . json () ) . then ( data => console . log ( data . access_token )) // Expected Output \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ.6z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE\" Making Calls With Access Token \u2693\ufe0e To interact with the API, add an Authorization header to your request with a value of Bearer TOKEN where TOKEN is your access token. Example: \u2693\ufe0e Get item CE 100. let access_token = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ.6z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE\" ; let queue = \"ce\" ; let item_number = 100 ; fetch ( `https://engineering.purdue.edu/webqueue/webqueue2/build/api/data/ ${ queue } / ${ item_number } ` , { headers : { \"Authorization\" : `Bearer ${ access_token } ` }} ) . then ( resp => resp . json () ) . then ( data => console . log ( data )); // Expected Output { queue : \"ce\" , number : 100 , lastUpdated : \"2021-03-11T07:24:00-0500\" ... } Refreshing Access Tokens \u2693\ufe0e When you login, you'll receive an access token that expires 15 minutes after creation as well as two cookies needed to get a new access token. Those cookies are: Name Value Path Expiration SameSite refresh_token_cookie Your refresh token. /api/tokens/refresh 30 Days Yes csrf_refresh_token Additional verification data. (e.g. 7b7c1ea8-f6bb-4204-99af-cd4124a69d89 ) / Session Yes The refresh_token_cookie is used to generate a new access token and will be sent back to the server with every request automatically. It expires 30 days after login. The csrf_refresh_token is used to verify the refresh_token_cookie and needs sent back as an X-CSRF-TOKEN header. To refresh your access token, make a POST request to the /api/tokens/refresh endpoint with the value of the csrf_refresh_token cookies inside a X-CSRF-TOKEN header: Example \u2693\ufe0e Get a new refresh token. // Get this value from your cookies. const csrf_refresh_token = \"7b7c1ea8-f6bb-4204-99af-cd4124a69d89\" fetch ( `https://engineering.purdue.edu/webqueue/webqueue2/build/api/tokens/refresh` , { method : \"POST\" , headers : { 'X-CSRF-TOKEN' : csrf_refresh_token } } ) . then ( resp => resp . json () ) . then ( data => console . log ( data . access_token )); // Expected Output eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9 . eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ .6 z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE","title":"Authentication"},{"location":"api/Authentication/#authentication","text":"The webqueue2 API uses a two stage authentication system combining Active Directory and HTTP Token (or \"bearer\") authentication.","title":"Authentication"},{"location":"api/Authentication/#getting-an-access-token","text":"All API calls require an access token. You can get an access token by making a POST request to the /api/login endpoint containing the JSON encoded username and password of a valid user. Who is a valid user? A valid user is a non-admin BoilerAD user who is in the 00000227-ECN-webqueue group. Users cannot be added directly to this group. To be included in this group, a user must exist in one of the following groups: 00000227-ECNStaff 00000227-ECNStuds 00000227-ECN-webqueue-misc","title":"Getting an Access Token"},{"location":"api/Authentication/#example","text":"Get an access token. fetch ( \"https://engineering.purdue.edu/webqueue/webqueue2/build/api/login\" , { method : \"POST\" , headers : { 'Content-Type' : 'application/json' }, body : JSON . stringify ({ \"username\" : USERNAME , \"password\" : PASSWORD }) } ) . then ( resp => resp . json () ) . then ( data => console . log ( data . access_token )) // Expected Output \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ.6z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE\"","title":"Example"},{"location":"api/Authentication/#making-calls-with-access-token","text":"To interact with the API, add an Authorization header to your request with a value of Bearer TOKEN where TOKEN is your access token.","title":"Making Calls With Access Token"},{"location":"api/Authentication/#example_1","text":"Get item CE 100. let access_token = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ.6z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE\" ; let queue = \"ce\" ; let item_number = 100 ; fetch ( `https://engineering.purdue.edu/webqueue/webqueue2/build/api/data/ ${ queue } / ${ item_number } ` , { headers : { \"Authorization\" : `Bearer ${ access_token } ` }} ) . then ( resp => resp . json () ) . then ( data => console . log ( data )); // Expected Output { queue : \"ce\" , number : 100 , lastUpdated : \"2021-03-11T07:24:00-0500\" ... }","title":"Example:"},{"location":"api/Authentication/#refreshing-access-tokens","text":"When you login, you'll receive an access token that expires 15 minutes after creation as well as two cookies needed to get a new access token. Those cookies are: Name Value Path Expiration SameSite refresh_token_cookie Your refresh token. /api/tokens/refresh 30 Days Yes csrf_refresh_token Additional verification data. (e.g. 7b7c1ea8-f6bb-4204-99af-cd4124a69d89 ) / Session Yes The refresh_token_cookie is used to generate a new access token and will be sent back to the server with every request automatically. It expires 30 days after login. The csrf_refresh_token is used to verify the refresh_token_cookie and needs sent back as an X-CSRF-TOKEN header. To refresh your access token, make a POST request to the /api/tokens/refresh endpoint with the value of the csrf_refresh_token cookies inside a X-CSRF-TOKEN header:","title":"Refreshing Access Tokens"},{"location":"api/Authentication/#example_2","text":"Get a new refresh token. // Get this value from your cookies. const csrf_refresh_token = \"7b7c1ea8-f6bb-4204-99af-cd4124a69d89\" fetch ( `https://engineering.purdue.edu/webqueue/webqueue2/build/api/tokens/refresh` , { method : \"POST\" , headers : { 'X-CSRF-TOKEN' : csrf_refresh_token } } ) . then ( resp => resp . json () ) . then ( data => console . log ( data . access_token )); // Expected Output eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9 . eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ .6 z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE","title":"Example"},{"location":"api/Getting%20Started/","text":"Getting Started \u2693\ufe0e The webqueue2 API is organized around REST . The API has resource oriented URLs, accepts and returns JSON encoded request bodies, can be modified via the query string and uses standard HTTP response codes and verbs. You can use the webqueue2 API hosted at https://engineering.purdue.edu/webqueue/webqueue2/build/api or install it on your own machine . Basic Usage \u2693\ufe0e Get the first item in CE queue. let access_token = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ.6z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE\" ; let queue = \"ce\" ; fetch ( `https://engineering.purdue.edu/webqueue/webqueue2/build/api/data/ ${ queue } ` , { headers : { \"Authorization\" : `Bearer ${ access_token } ` }} ) . then ( resp => resp . json () ) . then ( data => console . log ( data [ 0 ]. items [ 0 ] )); // Expected Output { queue : \"ce\" , number : 17 , lastUpdated : \"2021-03-29T17:12:00-0400\" ... } Get the subject of an CE 1. let access_token = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ.6z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE\" ; let queue = \"ce\" ; let item_number = 1 ; fetch ( `https://engineering.purdue.edu/webqueue/webqueue2/build/api/data/ ${ queue } / ${ item_number } ` , { headers : { \"Authorization\" : `Bearer ${ access_token } ` }} ) . then ( resp => resp . json () ) . then ( data => console . log ( data . subject )); // Expected Output \"Linux Server Purchase\"","title":"Getting Started"},{"location":"api/Getting%20Started/#getting-started","text":"The webqueue2 API is organized around REST . The API has resource oriented URLs, accepts and returns JSON encoded request bodies, can be modified via the query string and uses standard HTTP response codes and verbs. You can use the webqueue2 API hosted at https://engineering.purdue.edu/webqueue/webqueue2/build/api or install it on your own machine .","title":"Getting Started"},{"location":"api/Getting%20Started/#basic-usage","text":"Get the first item in CE queue. let access_token = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ.6z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE\" ; let queue = \"ce\" ; fetch ( `https://engineering.purdue.edu/webqueue/webqueue2/build/api/data/ ${ queue } ` , { headers : { \"Authorization\" : `Bearer ${ access_token } ` }} ) . then ( resp => resp . json () ) . then ( data => console . log ( data [ 0 ]. items [ 0 ] )); // Expected Output { queue : \"ce\" , number : 17 , lastUpdated : \"2021-03-29T17:12:00-0400\" ... } Get the subject of an CE 1. let access_token = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ.6z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE\" ; let queue = \"ce\" ; let item_number = 1 ; fetch ( `https://engineering.purdue.edu/webqueue/webqueue2/build/api/data/ ${ queue } / ${ item_number } ` , { headers : { \"Authorization\" : `Bearer ${ access_token } ` }} ) . then ( resp => resp . json () ) . then ( data => console . log ( data . subject )); // Expected Output \"Linux Server Purchase\"","title":"Basic Usage"},{"location":"api/Items/","text":"Items \u2693\ufe0e An item is a chronological representation of an interaction with a user. Endpoint \u2693\ufe0e GET /api/data/{queue}/{number} Parameters \u2693\ufe0e Name Value queue The queue of the item. number The number of the item. Query String Options \u2693\ufe0e Name Description Possible Values headers_only When \"True\" , only meta data will be loaded. When \"False\" content will be parsed. (Defaults to \"False\" .) \"True\" | \"False\" Return Codes \u2693\ufe0e Code Description 200 - Ok On success. 404 - Not Found When the Item does not exist. 500 - Internal Service Error On failure. Properties \u2693\ufe0e Item.assigned_to : \u2693\ufe0e Type Description String The Purdue career account alias of the person this item is assigned to. Example console . log ( Item . assigned_to ) // Expexted Output \"sundeep\" Item.building \u2693\ufe0e Type Description String The building a particular Item is related to. Example console . log ( Item . building ) // Expexted Output \"ME\" Item.content \u2693\ufe0e Type Description Array A chronological array of objects representing 1 of 9 possible actions taken on an item. Possible Actions Directory Information Information about the user info collected from ECNDB including but not limited to alias, phone number and office location. Properties Key Value type directory_information Name The real name of the sender. Login The career account alias of the sender. Computer The computer the item is related to. Formatting may vary. Location Where the computer is located. Email The email address of the sender. Phone The phone number of the sender. Office The office location of the sender. UNIX Dir The home directory for the user on non-Windows systems Zero Dir The home directory for the user via Active Directory User ECNDB Link to the sender's username report in ECNDB Host ECNDB Link to the computer report in ECNDB Subject The subject of the email sent to the queue Parsed Example { \"type\" : \"directory_information\" , \"Name\" : \"Nestor Fabian Rodriguez Buitrago\" , \"Login\" : \"rodri563\" , \"Computer\" : \"ce-205-38 (128.46.205.67)\" , \"Location\" : \"HAMP G230\" , \"Email\" : \"rodri563@purdue.edu\" , \"Phone\" : \"7654766893\" , \"Office\" : \"HAMP G230\" , \"UNIX Dir\" : \"/home/bridge/b/rodri563\" , \"Zero Dir\" : \"U=\\\\\\\\bridge.ecn.purdue.edu\\\\rodri563\" , \"User ECNDB\" : \"http://eng.purdue.edu/jump/2e8399a\" , \"Host ECNDB\" : \"http://eng.purdue.edu/jump/2e83999\" , \"Subject\" : \"Autocad installation\" } Initial Message The body of the email the item originated from. Properties Key Value type initial_message datetime RFC 8061 formatted datetime string. from_name The sender's real name. Formatting may vary. This can be empty. from_email The sender's email address. to A list of names(s) and email(s) of people this message was sent to. cc A list of name(s) and email(s) of people who were CC'd. This can be empty. subject The subject of the initial message. content The content of the message as an list of strings. Parsed Example { \"type\" : \"initial_message\" , \"datetime\" : \"2020-09-11T01:26:45+00:00\" , \"from_name\" : \"Justin Campbell\" , \"from_email\" : \"campb303@purdue.edu\" , \"to\" : [ { \"name\" : \"John Doe\" , \"email\" : \"johndoe@example.com\" }, ], \"cc\" : [ { \"name\" : \"\" , \"email\" : \"janesmith@example.com\" } ], \"subject\" : Maps to item . subject , \"content\" : [ \"I need some help with something.\\n\" ] } Edit Information added by someone at ECN, usually for internal use and/or communication. Properties Key Value type edit datetime RFC 8061 formatted datetime string. by The career account alias of the person who added the edit. content The content of the edit as a list of strings. Parsed Example { \"type\" : \"edit\" , \"datetime\" : \"2020-04-22T16:39:51\" , \"by\" : \"knewell\" , \"content\" : [ \"This is related to another item. I need to do X next.\\n\" ] } Status A short message about the progress of the item. Properties Key Value type status datetime RFC 8061 formatted datetime string. by The career account alias of the person who updated the status. content The content of the status as a list of strings. Parsed Example { \"type\" : \"status\" , \"datetime\" : \"2020-04-23T10:35:47\" , \"by\" : \"knewell\" , \"content\" : [ \"Doing X thing.\" ] } Assignment Assigning the item to someone. Properties Key Value type assignment datetime RFC 8061 formatted datetime string. by The career account alias of the person who changed the to The career account alias of the person who the item was assigned to. Parsed Example { \"type\" : \"assignment\" , \"datetime\" : \"2020-06-23T13:27:00\" , \"by\" : \"harley\" , \"to\" : \"campb303\" , } Reply To User A message from ECN to the user and/or related parties. Properties Key Value type reply_to_user datetime RFC 8061 formatted datetime string. by The sender's real name. Formatting may vary. This can be empty. content The content of the message as an list of strings Parsed Example { \"type\" : \"reply_to_user\" , \"datetime\" : \"2020-05-08T09:21:43\" , \"by\" : \"ewhile\" , \"content\" : [ \"Sascha,\\n\" , \"\\n\" , \"Chicken kevin biltong, flank jowl prosciutto shoulder meatball meatloaf sirloin.\\n\" , \"\\n\" , \"Ethan White\\n\" , \"ECN\" ] } Reply To User A message from ECN to the user and/or related parties. Properties Key Value type reply_to_user datetime RFC 8061 formatted datetime string. by The sender's real name. Formatting may vary. This can be empty. content The content of the message as an list of strings Parsed Example { \"type\" : \"reply_to_user\" , \"datetime\" : \"2020-05-08T09:21:43\" , \"by\" : \"ewhile\" , \"content\" : [ \"Sascha,\\n\" , \"\\n\" , \"Chicken kevin biltong, flank jowl prosciutto shoulder meatball meatloaf sirloin.\\n\" , \"\\n\" , \"Ethan White\\n\" , \"ECN\" ] } Reply From User A message from the user and/or related parties. Properties Key Value type reply_from_user datetime RFC 8061 formatted datetime string. from_name The sender's real name. Formatting may vary. This can be empty. from_email The sender's email address. cc A list of name(s) and email(s) of people who were CC'd. This can be empty. headers A dictionary of headers from the reply. subject The subject of the reply. content The content of the message as an list of strings Parsed Example { \"type\" : \"reply_from_user\" , \"datetime\" : \"2020-05-08T13:57:18+00:00\" , \"from_name\" : \"Reckowsky, Michael J.\" , \"from_email\" : \"mreckowsky@purdue.edu\" , \"cc\" : [ { \"name\" : \"John Doe\" , \"email\" : \"johndoe@example.com\" }, { \"name\" : \"\" , \"email\" : \"janesmith@example.com\" } ], \"headers\" : [ { \"type\" : \"Subject\" , \"content\" : \"RE: New Computer Deploy\" }, { \"type\" : \"From\" , \"content\" : \"\\\"Reckowsky, Michael J.\\\" \" }, { \"type\" : \"Date\" , \"content\" : \"Fri, 8 May 2020 13:57:17 +0000\" }, ], \"subject\" : \"RE: New Computer Deploy\" , \"content\" : [ \"Ethan,\\n\" , \"\\n\" , \"Biltong beef ribs doner chuck, pork chop jowl salami cow filet mignon pork.\\n\" , \"\\n\" , \"Mike\\n\" , ] } Parse Error An error caused by a malformed delimiter or nested delimiters. Properties Key Value type parse_error datetime RFC 8061 formatted datetime string. file_path Full path of the item with the error. expected Description of what the parser was expecting. got Line that cause the parse error. line_num The line number in the item that caused the parse error. Parsed Example { 'type' : 'parse_error' , 'datetime' : '2020-10-16T10:44:45' , 'file_path' : '/home/pier/e/benne238/webqueue2/q-snapshot/aae/2' , 'expected' : 'Did not encounter a reply-from-user ending delimiter' , 'got' : 'Kris' , 'line_num' : 468 } Item.date_received \u2693\ufe0e Type Description String An ISO 8601 formatted time string showing the date this item was created. Example console . log ( Item . date_received ) // Expexted Output \"2021-04-03T00:48:38+00:00\" Item.department \u2693\ufe0e Type Description String The most recent department for this item. Example console . log ( Item . department ) // Expexted Output \"Bussiness Office\" Item.headers \u2693\ufe0e Type Description Array An array of objects containing parsed item headers in type / value pairs. Example console . log ( Item . headers [ 0 ]) // Expexted Output { type : \"From\" , content : \"\\\"Campbell, Justin Tyler\\\" \\n\" } Item.is_locked \u2693\ufe0e Type Description Boolean A boolean showing whether or not a lockfile for the item is present. Example console . log ( Item . is_locked ) // Expexted Output true Item.last_updated \u2693\ufe0e Type Description String An ISO 8601 formatted time string showing the last time the file was updated according to the filesystem. Example console . log ( Item . last_updated ) // Expected Output \"2021-04-03T00:48:38+00:00\" Item.number \u2693\ufe0e Type Description Number The indentifying number of the queue item. Example console . log ( Item . number ) // Expected Output 4 Item.path \u2693\ufe0e Type Description String The absolute file path to the Item. Example console . log ( Item . path ) // Expected Output \"/home/pier/e/queue/Mail/ce/1\" Item.priority: \u2693\ufe0e Type Description String The most recent priority for this item. Example console . log ( Item . priority ) // Expexted Output \"COVID\" Item.queue: \u2693\ufe0e Type Description String The queue the Item is in. Example console . log ( Item . queue ) // Expexted Output \"ce\" Item.status \u2693\ufe0e Type Description String The most recent status update for the item. Example console . log ( Item . status ) // Expexted Output \"Waiting for Reply\" Item.subject: \u2693\ufe0e Type Description String The subject of the original message for this item. Example console . log ( Item . subject ) // Expexted Output \"Can't Access Outlook\" Item.user_alias : \u2693\ufe0e Type Description String The Purdue career account alias of the person this item is from. Example console . log ( Item . user_alias ) // Expexted Output \"campb303\" Item.user_email \u2693\ufe0e Type Description String The email address of the person who this item is from. Example console . log ( Item . user_email ) // Expexted Output \"campb303@purdue.edu\" Item.user_name \u2693\ufe0e Type Description String The real name of the person who this item is from. Example console . log ( Item . user_name ) // Expexted Output \"Justin Campbell\"","title":"Items"},{"location":"api/Items/#items","text":"An item is a chronological representation of an interaction with a user.","title":"Items"},{"location":"api/Items/#endpoint","text":"GET /api/data/{queue}/{number}","title":"Endpoint"},{"location":"api/Items/#parameters","text":"Name Value queue The queue of the item. number The number of the item.","title":"Parameters"},{"location":"api/Items/#query-string-options","text":"Name Description Possible Values headers_only When \"True\" , only meta data will be loaded. When \"False\" content will be parsed. (Defaults to \"False\" .) \"True\" | \"False\"","title":"Query String Options"},{"location":"api/Items/#return-codes","text":"Code Description 200 - Ok On success. 404 - Not Found When the Item does not exist. 500 - Internal Service Error On failure.","title":"Return Codes"},{"location":"api/Items/#properties","text":"","title":"Properties"},{"location":"api/Items/#itemassigned_to","text":"Type Description String The Purdue career account alias of the person this item is assigned to. Example console . log ( Item . assigned_to ) // Expexted Output \"sundeep\"","title":"Item.assigned_to:"},{"location":"api/Items/#itembuilding","text":"Type Description String The building a particular Item is related to. Example console . log ( Item . building ) // Expexted Output \"ME\"","title":"Item.building"},{"location":"api/Items/#itemcontent","text":"Type Description Array A chronological array of objects representing 1 of 9 possible actions taken on an item. Possible Actions Directory Information Information about the user info collected from ECNDB including but not limited to alias, phone number and office location. Properties Key Value type directory_information Name The real name of the sender. Login The career account alias of the sender. Computer The computer the item is related to. Formatting may vary. Location Where the computer is located. Email The email address of the sender. Phone The phone number of the sender. Office The office location of the sender. UNIX Dir The home directory for the user on non-Windows systems Zero Dir The home directory for the user via Active Directory User ECNDB Link to the sender's username report in ECNDB Host ECNDB Link to the computer report in ECNDB Subject The subject of the email sent to the queue Parsed Example { \"type\" : \"directory_information\" , \"Name\" : \"Nestor Fabian Rodriguez Buitrago\" , \"Login\" : \"rodri563\" , \"Computer\" : \"ce-205-38 (128.46.205.67)\" , \"Location\" : \"HAMP G230\" , \"Email\" : \"rodri563@purdue.edu\" , \"Phone\" : \"7654766893\" , \"Office\" : \"HAMP G230\" , \"UNIX Dir\" : \"/home/bridge/b/rodri563\" , \"Zero Dir\" : \"U=\\\\\\\\bridge.ecn.purdue.edu\\\\rodri563\" , \"User ECNDB\" : \"http://eng.purdue.edu/jump/2e8399a\" , \"Host ECNDB\" : \"http://eng.purdue.edu/jump/2e83999\" , \"Subject\" : \"Autocad installation\" } Initial Message The body of the email the item originated from. Properties Key Value type initial_message datetime RFC 8061 formatted datetime string. from_name The sender's real name. Formatting may vary. This can be empty. from_email The sender's email address. to A list of names(s) and email(s) of people this message was sent to. cc A list of name(s) and email(s) of people who were CC'd. This can be empty. subject The subject of the initial message. content The content of the message as an list of strings. Parsed Example { \"type\" : \"initial_message\" , \"datetime\" : \"2020-09-11T01:26:45+00:00\" , \"from_name\" : \"Justin Campbell\" , \"from_email\" : \"campb303@purdue.edu\" , \"to\" : [ { \"name\" : \"John Doe\" , \"email\" : \"johndoe@example.com\" }, ], \"cc\" : [ { \"name\" : \"\" , \"email\" : \"janesmith@example.com\" } ], \"subject\" : Maps to item . subject , \"content\" : [ \"I need some help with something.\\n\" ] } Edit Information added by someone at ECN, usually for internal use and/or communication. Properties Key Value type edit datetime RFC 8061 formatted datetime string. by The career account alias of the person who added the edit. content The content of the edit as a list of strings. Parsed Example { \"type\" : \"edit\" , \"datetime\" : \"2020-04-22T16:39:51\" , \"by\" : \"knewell\" , \"content\" : [ \"This is related to another item. I need to do X next.\\n\" ] } Status A short message about the progress of the item. Properties Key Value type status datetime RFC 8061 formatted datetime string. by The career account alias of the person who updated the status. content The content of the status as a list of strings. Parsed Example { \"type\" : \"status\" , \"datetime\" : \"2020-04-23T10:35:47\" , \"by\" : \"knewell\" , \"content\" : [ \"Doing X thing.\" ] } Assignment Assigning the item to someone. Properties Key Value type assignment datetime RFC 8061 formatted datetime string. by The career account alias of the person who changed the to The career account alias of the person who the item was assigned to. Parsed Example { \"type\" : \"assignment\" , \"datetime\" : \"2020-06-23T13:27:00\" , \"by\" : \"harley\" , \"to\" : \"campb303\" , } Reply To User A message from ECN to the user and/or related parties. Properties Key Value type reply_to_user datetime RFC 8061 formatted datetime string. by The sender's real name. Formatting may vary. This can be empty. content The content of the message as an list of strings Parsed Example { \"type\" : \"reply_to_user\" , \"datetime\" : \"2020-05-08T09:21:43\" , \"by\" : \"ewhile\" , \"content\" : [ \"Sascha,\\n\" , \"\\n\" , \"Chicken kevin biltong, flank jowl prosciutto shoulder meatball meatloaf sirloin.\\n\" , \"\\n\" , \"Ethan White\\n\" , \"ECN\" ] } Reply To User A message from ECN to the user and/or related parties. Properties Key Value type reply_to_user datetime RFC 8061 formatted datetime string. by The sender's real name. Formatting may vary. This can be empty. content The content of the message as an list of strings Parsed Example { \"type\" : \"reply_to_user\" , \"datetime\" : \"2020-05-08T09:21:43\" , \"by\" : \"ewhile\" , \"content\" : [ \"Sascha,\\n\" , \"\\n\" , \"Chicken kevin biltong, flank jowl prosciutto shoulder meatball meatloaf sirloin.\\n\" , \"\\n\" , \"Ethan White\\n\" , \"ECN\" ] } Reply From User A message from the user and/or related parties. Properties Key Value type reply_from_user datetime RFC 8061 formatted datetime string. from_name The sender's real name. Formatting may vary. This can be empty. from_email The sender's email address. cc A list of name(s) and email(s) of people who were CC'd. This can be empty. headers A dictionary of headers from the reply. subject The subject of the reply. content The content of the message as an list of strings Parsed Example { \"type\" : \"reply_from_user\" , \"datetime\" : \"2020-05-08T13:57:18+00:00\" , \"from_name\" : \"Reckowsky, Michael J.\" , \"from_email\" : \"mreckowsky@purdue.edu\" , \"cc\" : [ { \"name\" : \"John Doe\" , \"email\" : \"johndoe@example.com\" }, { \"name\" : \"\" , \"email\" : \"janesmith@example.com\" } ], \"headers\" : [ { \"type\" : \"Subject\" , \"content\" : \"RE: New Computer Deploy\" }, { \"type\" : \"From\" , \"content\" : \"\\\"Reckowsky, Michael J.\\\" \" }, { \"type\" : \"Date\" , \"content\" : \"Fri, 8 May 2020 13:57:17 +0000\" }, ], \"subject\" : \"RE: New Computer Deploy\" , \"content\" : [ \"Ethan,\\n\" , \"\\n\" , \"Biltong beef ribs doner chuck, pork chop jowl salami cow filet mignon pork.\\n\" , \"\\n\" , \"Mike\\n\" , ] } Parse Error An error caused by a malformed delimiter or nested delimiters. Properties Key Value type parse_error datetime RFC 8061 formatted datetime string. file_path Full path of the item with the error. expected Description of what the parser was expecting. got Line that cause the parse error. line_num The line number in the item that caused the parse error. Parsed Example { 'type' : 'parse_error' , 'datetime' : '2020-10-16T10:44:45' , 'file_path' : '/home/pier/e/benne238/webqueue2/q-snapshot/aae/2' , 'expected' : 'Did not encounter a reply-from-user ending delimiter' , 'got' : 'Kris' , 'line_num' : 468 }","title":"Item.content"},{"location":"api/Items/#itemdate_received","text":"Type Description String An ISO 8601 formatted time string showing the date this item was created. Example console . log ( Item . date_received ) // Expexted Output \"2021-04-03T00:48:38+00:00\"","title":"Item.date_received"},{"location":"api/Items/#itemdepartment","text":"Type Description String The most recent department for this item. Example console . log ( Item . department ) // Expexted Output \"Bussiness Office\"","title":"Item.department"},{"location":"api/Items/#itemheaders","text":"Type Description Array An array of objects containing parsed item headers in type / value pairs. Example console . log ( Item . headers [ 0 ]) // Expexted Output { type : \"From\" , content : \"\\\"Campbell, Justin Tyler\\\" \\n\" }","title":"Item.headers"},{"location":"api/Items/#itemis_locked","text":"Type Description Boolean A boolean showing whether or not a lockfile for the item is present. Example console . log ( Item . is_locked ) // Expexted Output true","title":"Item.is_locked"},{"location":"api/Items/#itemlast_updated","text":"Type Description String An ISO 8601 formatted time string showing the last time the file was updated according to the filesystem. Example console . log ( Item . last_updated ) // Expected Output \"2021-04-03T00:48:38+00:00\"","title":"Item.last_updated"},{"location":"api/Items/#itemnumber","text":"Type Description Number The indentifying number of the queue item. Example console . log ( Item . number ) // Expected Output 4","title":"Item.number"},{"location":"api/Items/#itempath","text":"Type Description String The absolute file path to the Item. Example console . log ( Item . path ) // Expected Output \"/home/pier/e/queue/Mail/ce/1\"","title":"Item.path"},{"location":"api/Items/#itempriority","text":"Type Description String The most recent priority for this item. Example console . log ( Item . priority ) // Expexted Output \"COVID\"","title":"Item.priority:"},{"location":"api/Items/#itemqueue","text":"Type Description String The queue the Item is in. Example console . log ( Item . queue ) // Expexted Output \"ce\"","title":"Item.queue:"},{"location":"api/Items/#itemstatus","text":"Type Description String The most recent status update for the item. Example console . log ( Item . status ) // Expexted Output \"Waiting for Reply\"","title":"Item.status"},{"location":"api/Items/#itemsubject","text":"Type Description String The subject of the original message for this item. Example console . log ( Item . subject ) // Expexted Output \"Can't Access Outlook\"","title":"Item.subject:"},{"location":"api/Items/#itemuser_alias","text":"Type Description String The Purdue career account alias of the person this item is from. Example console . log ( Item . user_alias ) // Expexted Output \"campb303\"","title":"Item.user_alias:"},{"location":"api/Items/#itemuser_email","text":"Type Description String The email address of the person who this item is from. Example console . log ( Item . user_email ) // Expexted Output \"campb303@purdue.edu\"","title":"Item.user_email"},{"location":"api/Items/#itemuser_name","text":"Type Description String The real name of the person who this item is from. Example console . log ( Item . user_name ) // Expexted Output \"Justin Campbell\"","title":"Item.user_name"},{"location":"api/Queues/","text":"Queues \u2693\ufe0e A collection of Items . Endpoint \u2693\ufe0e GET /api/data/{queue} Parameters \u2693\ufe0e Name Value queue The name of the queue. Query String Options \u2693\ufe0e Name Description Possible Values headers_only When \"True\" , only meta data will be loaded. When \"False\" content will be parsed. (Defaults to \"True\" .) \"True\" | \"True\" Return Codes \u2693\ufe0e Code Description 200 - Ok On success. 404 - Not Found When the Queue does not exist. 500 - Internal Service Error On failure. Properties \u2693\ufe0e Queue.name \u2693\ufe0e Type Description String The name of the queue. Example console . log ( Queue . name ) // Expected Output \"ce\" Queue.path \u2693\ufe0e Type Description String The absolute file path to the Queue. Example console . log ( Queue . path ) // Expected Output \"/home/pier/e/queue/Mail/ce\" Queue.items \u2693\ufe0e Type Description Array The Items in the queue. Example console . log ( Queue . items ) // Expected Output [ { queue : \"ce\" , number : 01 , lastUpdated : \"2021-03-26T17:12:00-0400\" ... } { queue : \"ce\" , number : 02 , lastUpdated : \"2021-05-29T17:12:00-0400\" ... } { queue : \"ce\" , number : 03 , lastUpdated : \"2020-12-29T17:12:00-0400\" ... } ]","title":"Queues"},{"location":"api/Queues/#queues","text":"A collection of Items .","title":"Queues"},{"location":"api/Queues/#endpoint","text":"GET /api/data/{queue}","title":"Endpoint"},{"location":"api/Queues/#parameters","text":"Name Value queue The name of the queue.","title":"Parameters"},{"location":"api/Queues/#query-string-options","text":"Name Description Possible Values headers_only When \"True\" , only meta data will be loaded. When \"False\" content will be parsed. (Defaults to \"True\" .) \"True\" | \"True\"","title":"Query String Options"},{"location":"api/Queues/#return-codes","text":"Code Description 200 - Ok On success. 404 - Not Found When the Queue does not exist. 500 - Internal Service Error On failure.","title":"Return Codes"},{"location":"api/Queues/#properties","text":"","title":"Properties"},{"location":"api/Queues/#queuename","text":"Type Description String The name of the queue. Example console . log ( Queue . name ) // Expected Output \"ce\"","title":"Queue.name"},{"location":"api/Queues/#queuepath","text":"Type Description String The absolute file path to the Queue. Example console . log ( Queue . path ) // Expected Output \"/home/pier/e/queue/Mail/ce\"","title":"Queue.path"},{"location":"api/Queues/#queueitems","text":"Type Description Array The Items in the queue. Example console . log ( Queue . items ) // Expected Output [ { queue : \"ce\" , number : 01 , lastUpdated : \"2021-03-26T17:12:00-0400\" ... } { queue : \"ce\" , number : 02 , lastUpdated : \"2021-05-29T17:12:00-0400\" ... } { queue : \"ce\" , number : 03 , lastUpdated : \"2020-12-29T17:12:00-0400\" ... } ]","title":"Queue.items"},{"location":"webqueue2api%20Package/Getting%20Started/","text":"Getting Started \u2693\ufe0e The webqueue2api Package provides both a parser to read data from ECN's queue and allow for programatic data access as well as an WSGI application to serve the webqueue2 API. The webqueue2api Package has the following structure: webqueue2api : Contains global configuration and exports utilities/data classes. parser : Contains classes for reading data from queue text files and making it available via objects. api : Contains a WSGI application to host a RESTful API that relies on parser . Basic Usage \u2693\ufe0e Load a queue and get the number of items in it. import webqueue2api ce_queue = webqueue2api . Queue ( \"ce\" ) print ( len ( ce_queue . items ) ) # Expected Output 29 Load an item and get its subject. import webqueue2api ce_1 = webqueue2api . Item ( \"ce\" , 1 ) print ( len ( ce_1 . subject ) ) # Expected Output \"Re: Battery Replacement\"","title":"Getting Started"},{"location":"webqueue2api%20Package/Getting%20Started/#getting-started","text":"The webqueue2api Package provides both a parser to read data from ECN's queue and allow for programatic data access as well as an WSGI application to serve the webqueue2 API. The webqueue2api Package has the following structure: webqueue2api : Contains global configuration and exports utilities/data classes. parser : Contains classes for reading data from queue text files and making it available via objects. api : Contains a WSGI application to host a RESTful API that relies on parser .","title":"Getting Started"},{"location":"webqueue2api%20Package/Getting%20Started/#basic-usage","text":"Load a queue and get the number of items in it. import webqueue2api ce_queue = webqueue2api . Queue ( \"ce\" ) print ( len ( ce_queue . items ) ) # Expected Output 29 Load an item and get its subject. import webqueue2api ce_1 = webqueue2api . Item ( \"ce\" , 1 ) print ( len ( ce_1 . subject ) ) # Expected Output \"Re: Battery Replacement\"","title":"Basic Usage"},{"location":"webqueue2api%20Package/Package%20Structure/","text":"Hierarchy \u2693\ufe0e The webqueue2api Package consists of four packages in total: webqueue2api : The root packages. This contains both the api and the parser packages as well as global configuration. api : Contains a Flask app that can be used with any WSGI server to host the webqueue2 API and utilities such as authentication code. resources : Contains Flask-RESTful resources for the webqueue2 API. parser : Contains parers for a Queue and an Item as well as utilities and custom errors. Configuration \u2693\ufe0e Each package contains package level configuration objects (see: dataclasses on PyPI ) in config.py files. All of the configurations are combined into the top level webqueue2api.config symbol. These configuration objects store default values for each package. Default values can be changed by editing these objects directly or by editing the object values before their use. Changing the parser's queue directory by editing object values. import webqueue2api # Load Queue from default directory ce_queue = Queue ( \"ce\" ) # load Queue from modified directory webqueue2api . config . parser . queue_directory = \"/absolute/path\" other_queue = Queue ( \"other\" )","title":"Package Structure"},{"location":"webqueue2api%20Package/Package%20Structure/#hierarchy","text":"The webqueue2api Package consists of four packages in total: webqueue2api : The root packages. This contains both the api and the parser packages as well as global configuration. api : Contains a Flask app that can be used with any WSGI server to host the webqueue2 API and utilities such as authentication code. resources : Contains Flask-RESTful resources for the webqueue2 API. parser : Contains parers for a Queue and an Item as well as utilities and custom errors.","title":"Hierarchy"},{"location":"webqueue2api%20Package/Package%20Structure/#configuration","text":"Each package contains package level configuration objects (see: dataclasses on PyPI ) in config.py files. All of the configurations are combined into the top level webqueue2api.config symbol. These configuration objects store default values for each package. Default values can be changed by editing these objects directly or by editing the object values before their use. Changing the parser's queue directory by editing object values. import webqueue2api # Load Queue from default directory ce_queue = Queue ( \"ce\" ) # load Queue from modified directory webqueue2api . config . parser . queue_directory = \"/absolute/path\" other_queue = Queue ( \"other\" )","title":"Configuration"}]} \ No newline at end of file +{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"See the API Docs . See the Python Package Docs","title":"Home"},{"location":"Dev%20Environment%20Setup%20Guide/","text":"Dev Environment Setup Guide \u2693\ufe0e This document will walk you through the setup and configuration of a development environment for webqueue2 using the provided development machines, SSH authentication, GitHub and VS Code. Prerequisites \u2693\ufe0e On Your Computer \u2693\ufe0e VS Code Cisco AnyConnect for WebVPN On The Development Computer \u2693\ufe0e Note These are already installed on the provided development machines. git Python >= 3.6.9 Configuring Your SSH Keys \u2693\ufe0e We will be using SSH keys to authenticate to both the development machines and GitHub. In either PowerShell on Windows or bash on macOS/Linux, run the following command and accept all defaults by pressing Enter : ssh-keygen This will create the files id_rsa and id_rsa.pub in the .ssh folder inside your user's folder. Your user's folder can usually be found at: Windows C:\\Users\\ macOS /Users/ Linux /home/ Note Most CLI shells like PowerShell and bash use the ~ (tilda) key as a shortcut for your user's folder. You can confirm these files were created by running: ls ~/.ssh/ Configuring SSH \u2693\ufe0e In your editor of choice, create the file ~/.ssh/config and add this: Tip Replace campb303 with your career account username and replace w2vm1 with the name of the provided development machine you're connecting to. Host campb303-w2vm1 HostName w2vm1.ecn.purdue.edu User campb303 # Forward Flask Debug Port LocalForward 5000 localhost:5000 # Forward MkDocs Port LocalForward 5000 localhost:6060 # Forward gunicorn Port LocalForward 8000 localhost:8000 The configuration above will allow you to connect to the development machine and automatically forward ports for development tools to work. Here's a bit more detail about what's going on: Key Value Host A friendly name to identify an SSH host by. This can be anything. HostName The DNS name or IP address of the computer you're connecting to. User The name of your user on the computer you're connecting to. LocalForward Forwards a port on your computer to a port on the computer you're connecting to. Development machines are not publicly accessible. You'll need to be connected to WebVPN to connect to them. SSH Jump Hosts WebVPN works on all platforms but requires an extra step to get to work. On macOS/Linux, pier.ecn.purdue.edu can be used as an SSH jump host allowing for development machines to be connected to automatically when openning VS Code. Assuming you already have an SSH key configured for pier.ecn.purdue.edu , you can use a jump host by adding the following to ~/.ssh/config : Host campb303-pier HostName pier.ecn.purdue.edu User campb303 Host campb303-w2vm1 HostName w2vm1.ecn.purdue.edu ProxyJump campb303-pier User campb303 # Forward Flask Debug Port LocalForward 5000 localhost:5000 # Forward MkDocs Port LocalForward 5000 localhost:6060 # Forward gunicorn Port LocalForward 8000 localhost:8000 To test your configuration, run ssh followed by the Host value. When prompted for your password, enter your career account password and press Enter . Warning Most shell environemnts like PowerShell and bash do not show your password being typed but it is being typed. For the configuration above you would run: ssh campb303-w2vm1 campb303@w2vm1's password: Adding SSH Keys \u2693\ufe0e Now that we've generated SSH keys and configured our host entries, we need to add our SSH key to the host. This will allow us to connect to these machines without passwords later. Tip Replace HOST below with the value from above. Example: campb303-w2vm1 PowerShell on Windows type $env:USERPROFILE \\. ssh \\ id_rsa . pub | ssh HOST \"cat >> .ssh/authorized_keys\" bash on macOS/Linux ssh-copy-id HOST If the key was added successfully, you can login without entering a password by running: ssh HOST Installing VS Code \u2693\ufe0e Download and install VS Code . Be sure to add code to your PATH. Windows Adding code to your PATH on Windows is a checkbox in the installer: Image from this article on Techomoro macOS/Linux Adding code to your PATH on macOS/Linux is accessible by searching for \"PATH\" in the Command Pallete. You can access the Command Pallete with the keyboard shortcut Command / Ctrl + Shift + P : Image from this StackOverflow thread Connecting To The Development Machine \u2693\ufe0e Install the Remote - SSH plugin. After installation a new icon will appear in the sidebar: Click on the Remote SSH icon and you'll see the SSH host you just defined Select the host and click the New Window icon to connect. A new window connected to that host will appear Note This may take a couple of minutes on the first connection while VS Code installs its server. If prompted for a platform, select Linux: Adding Your SSH Keys to GitHub \u2693\ufe0e Because the development machine will be the computer that connects to GitHub, we need to create another SSH key and add it to our GitHub profile: First, open VS Code's integrated terminal by pressing Control + ~ (tilda) Now run the following command and accept all defaults by pressing Enter : ssh-keygen This will create the files id_rsa and id_rsa.pub in ~/.ssh/ . You can confirm this by running: ls ~/.ssh/ Now copy the public key from id_rsa.pub by openning the file in VS Code, selecting its contents and copying it. You can open the file in VS Code by running the following in the integrated terminal: Danger Do not copy your private key from id_rsa ! This key should never leave your machine. code ~/.ssh/id_rsa.pub Now go to github.itap.purdue.edu/settings/keys . You may be prompted to login using your career account username and password. Click the \"New SSH Key\" button Give the key a title that tells you what device the key is from (e.g. Desktop or Dev Machine) Paste the contents of id_rsa.pub into the key box Click the \"Add SSH Key\" button Cloning and Opening the Repository \u2693\ufe0e Using the integrated terminal in VS Code, run: git clone git@github.itap.purdue.edu:ECN/webqueue2-api.git This will create a webqueue2-api folder in your user's home directory. Open this directory using the \"Open Folder\" button: Note VS Code will automatically reconnect to the last remote host used when it reopens. Tip If you need to reconnect manually, there will now be an option to open the webqueue2-api folder directly from the Remote Hosts menu: Configuring VS Code \u2693\ufe0e Installing Extensions \u2693\ufe0e Pylance for Python language support, IntelliSense, virtual environments and debugging Git Graph for a more detailed view of git info Markdown Preview GitHub Styling for previewing Markdown as it will appear on GitHub Python Docstring Generator for generating Google style docstrings according to section 3.8 of Google's Python style guide Configuring Extensions \u2693\ufe0e Python \u2693\ufe0e The Python extension supports virtual environments but needs to be told where the virtual environment is. Create or modify the file .vscode/settings.json and add the following: \"python.defaultInterpreterPath\": \"./venv/bin/python3\" Tip The Python extension may complain and tell you to select another interpreter. Ignore this warning for now. Python Docstring Generator \u2693\ufe0e For consistentcy, we'll use a docstring template. Create or modify the file .vscode/settings.json and add the following: \"autoDocstring.customTemplatePath\": \"./docstring-format.mustache\" At this point, your .vscode/settings.json file should look like this: { \"python.pythonPath\": \"./venv/bin/python3\", \"autoDocstring.customTemplatePath\": \"./docstring-format.mustache\" } Setting Up the Virtual Environment \u2693\ufe0e For development, we'll use a Python Virtual Environment to isolate out changes and have a reproducible dev environment. In VS Code's integrated terminal: Create a virtual environment at ./venv/ : python3 -m venv venv Activate the virtual environment: source venv/bin/activate Tip To deactivate the virtual environment and use your system's Python interpreter, run: deactivate Update pip within the virtual environment: pip install -U pip Install the webqueue2 API within the virtual environemt: pip install -e .[all] -e installs a package in editable mode which allows code changes to take effect without reinstalling a package. webqueue2 API has multiple conditional dependencies : Condition Installation Command Description Production pip install . For use in production. Only installed needed packages. Development pip install .[dev] For use in development. Installs everything for production and extra packages for development. Documentation pip install .[docs] For use in creating documentation. Installs everything for production and extra packages for documentation. All pip install .[all] A shortcut for installing production, development and documentation dependencies. API Commands \u2693\ufe0e Command Description gunicorn webqueue2api.api:app This will start a local server on localhost:8000 to access the API. mkdocs serve This will start a local server on localhost:6060 to access the API docs. As you change API documentation files in ./docs/ you'll see your changes in the browser. mkdocs build This will output a static bundle of the API documentation in ./site/ that can be put on any webserver.","title":"Dev Environment Setup Guide"},{"location":"Dev%20Environment%20Setup%20Guide/#dev-environment-setup-guide","text":"This document will walk you through the setup and configuration of a development environment for webqueue2 using the provided development machines, SSH authentication, GitHub and VS Code.","title":"Dev Environment Setup Guide"},{"location":"Dev%20Environment%20Setup%20Guide/#prerequisites","text":"","title":"Prerequisites"},{"location":"Dev%20Environment%20Setup%20Guide/#on-your-computer","text":"VS Code Cisco AnyConnect for WebVPN","title":"On Your Computer"},{"location":"Dev%20Environment%20Setup%20Guide/#on-the-development-computer","text":"Note These are already installed on the provided development machines. git Python >= 3.6.9","title":"On The Development Computer"},{"location":"Dev%20Environment%20Setup%20Guide/#configuring-your-ssh-keys","text":"We will be using SSH keys to authenticate to both the development machines and GitHub. In either PowerShell on Windows or bash on macOS/Linux, run the following command and accept all defaults by pressing Enter : ssh-keygen This will create the files id_rsa and id_rsa.pub in the .ssh folder inside your user's folder. Your user's folder can usually be found at: Windows C:\\Users\\ macOS /Users/ Linux /home/ Note Most CLI shells like PowerShell and bash use the ~ (tilda) key as a shortcut for your user's folder. You can confirm these files were created by running: ls ~/.ssh/","title":"Configuring Your SSH Keys"},{"location":"Dev%20Environment%20Setup%20Guide/#configuring-ssh","text":"In your editor of choice, create the file ~/.ssh/config and add this: Tip Replace campb303 with your career account username and replace w2vm1 with the name of the provided development machine you're connecting to. Host campb303-w2vm1 HostName w2vm1.ecn.purdue.edu User campb303 # Forward Flask Debug Port LocalForward 5000 localhost:5000 # Forward MkDocs Port LocalForward 5000 localhost:6060 # Forward gunicorn Port LocalForward 8000 localhost:8000 The configuration above will allow you to connect to the development machine and automatically forward ports for development tools to work. Here's a bit more detail about what's going on: Key Value Host A friendly name to identify an SSH host by. This can be anything. HostName The DNS name or IP address of the computer you're connecting to. User The name of your user on the computer you're connecting to. LocalForward Forwards a port on your computer to a port on the computer you're connecting to. Development machines are not publicly accessible. You'll need to be connected to WebVPN to connect to them. SSH Jump Hosts WebVPN works on all platforms but requires an extra step to get to work. On macOS/Linux, pier.ecn.purdue.edu can be used as an SSH jump host allowing for development machines to be connected to automatically when openning VS Code. Assuming you already have an SSH key configured for pier.ecn.purdue.edu , you can use a jump host by adding the following to ~/.ssh/config : Host campb303-pier HostName pier.ecn.purdue.edu User campb303 Host campb303-w2vm1 HostName w2vm1.ecn.purdue.edu ProxyJump campb303-pier User campb303 # Forward Flask Debug Port LocalForward 5000 localhost:5000 # Forward MkDocs Port LocalForward 5000 localhost:6060 # Forward gunicorn Port LocalForward 8000 localhost:8000 To test your configuration, run ssh followed by the Host value. When prompted for your password, enter your career account password and press Enter . Warning Most shell environemnts like PowerShell and bash do not show your password being typed but it is being typed. For the configuration above you would run: ssh campb303-w2vm1 campb303@w2vm1's password:","title":"Configuring SSH"},{"location":"Dev%20Environment%20Setup%20Guide/#adding-ssh-keys","text":"Now that we've generated SSH keys and configured our host entries, we need to add our SSH key to the host. This will allow us to connect to these machines without passwords later. Tip Replace HOST below with the value from above. Example: campb303-w2vm1 PowerShell on Windows type $env:USERPROFILE \\. ssh \\ id_rsa . pub | ssh HOST \"cat >> .ssh/authorized_keys\" bash on macOS/Linux ssh-copy-id HOST If the key was added successfully, you can login without entering a password by running: ssh HOST","title":"Adding SSH Keys"},{"location":"Dev%20Environment%20Setup%20Guide/#installing-vs-code","text":"Download and install VS Code . Be sure to add code to your PATH. Windows Adding code to your PATH on Windows is a checkbox in the installer: Image from this article on Techomoro macOS/Linux Adding code to your PATH on macOS/Linux is accessible by searching for \"PATH\" in the Command Pallete. You can access the Command Pallete with the keyboard shortcut Command / Ctrl + Shift + P : Image from this StackOverflow thread","title":"Installing VS Code"},{"location":"Dev%20Environment%20Setup%20Guide/#connecting-to-the-development-machine","text":"Install the Remote - SSH plugin. After installation a new icon will appear in the sidebar: Click on the Remote SSH icon and you'll see the SSH host you just defined Select the host and click the New Window icon to connect. A new window connected to that host will appear Note This may take a couple of minutes on the first connection while VS Code installs its server. If prompted for a platform, select Linux:","title":"Connecting To The Development Machine"},{"location":"Dev%20Environment%20Setup%20Guide/#adding-your-ssh-keys-to-github","text":"Because the development machine will be the computer that connects to GitHub, we need to create another SSH key and add it to our GitHub profile: First, open VS Code's integrated terminal by pressing Control + ~ (tilda) Now run the following command and accept all defaults by pressing Enter : ssh-keygen This will create the files id_rsa and id_rsa.pub in ~/.ssh/ . You can confirm this by running: ls ~/.ssh/ Now copy the public key from id_rsa.pub by openning the file in VS Code, selecting its contents and copying it. You can open the file in VS Code by running the following in the integrated terminal: Danger Do not copy your private key from id_rsa ! This key should never leave your machine. code ~/.ssh/id_rsa.pub Now go to github.itap.purdue.edu/settings/keys . You may be prompted to login using your career account username and password. Click the \"New SSH Key\" button Give the key a title that tells you what device the key is from (e.g. Desktop or Dev Machine) Paste the contents of id_rsa.pub into the key box Click the \"Add SSH Key\" button","title":"Adding Your SSH Keys to GitHub"},{"location":"Dev%20Environment%20Setup%20Guide/#cloning-and-opening-the-repository","text":"Using the integrated terminal in VS Code, run: git clone git@github.itap.purdue.edu:ECN/webqueue2-api.git This will create a webqueue2-api folder in your user's home directory. Open this directory using the \"Open Folder\" button: Note VS Code will automatically reconnect to the last remote host used when it reopens. Tip If you need to reconnect manually, there will now be an option to open the webqueue2-api folder directly from the Remote Hosts menu:","title":"Cloning and Opening the Repository"},{"location":"Dev%20Environment%20Setup%20Guide/#configuring-vs-code","text":"","title":"Configuring VS Code"},{"location":"Dev%20Environment%20Setup%20Guide/#installing-extensions","text":"Pylance for Python language support, IntelliSense, virtual environments and debugging Git Graph for a more detailed view of git info Markdown Preview GitHub Styling for previewing Markdown as it will appear on GitHub Python Docstring Generator for generating Google style docstrings according to section 3.8 of Google's Python style guide","title":"Installing Extensions"},{"location":"Dev%20Environment%20Setup%20Guide/#configuring-extensions","text":"","title":"Configuring Extensions"},{"location":"Dev%20Environment%20Setup%20Guide/#python","text":"The Python extension supports virtual environments but needs to be told where the virtual environment is. Create or modify the file .vscode/settings.json and add the following: \"python.defaultInterpreterPath\": \"./venv/bin/python3\" Tip The Python extension may complain and tell you to select another interpreter. Ignore this warning for now.","title":"Python"},{"location":"Dev%20Environment%20Setup%20Guide/#python-docstring-generator","text":"For consistentcy, we'll use a docstring template. Create or modify the file .vscode/settings.json and add the following: \"autoDocstring.customTemplatePath\": \"./docstring-format.mustache\" At this point, your .vscode/settings.json file should look like this: { \"python.pythonPath\": \"./venv/bin/python3\", \"autoDocstring.customTemplatePath\": \"./docstring-format.mustache\" }","title":"Python Docstring Generator"},{"location":"Dev%20Environment%20Setup%20Guide/#setting-up-the-virtual-environment","text":"For development, we'll use a Python Virtual Environment to isolate out changes and have a reproducible dev environment. In VS Code's integrated terminal: Create a virtual environment at ./venv/ : python3 -m venv venv Activate the virtual environment: source venv/bin/activate Tip To deactivate the virtual environment and use your system's Python interpreter, run: deactivate Update pip within the virtual environment: pip install -U pip Install the webqueue2 API within the virtual environemt: pip install -e .[all] -e installs a package in editable mode which allows code changes to take effect without reinstalling a package. webqueue2 API has multiple conditional dependencies : Condition Installation Command Description Production pip install . For use in production. Only installed needed packages. Development pip install .[dev] For use in development. Installs everything for production and extra packages for development. Documentation pip install .[docs] For use in creating documentation. Installs everything for production and extra packages for documentation. All pip install .[all] A shortcut for installing production, development and documentation dependencies.","title":"Setting Up the Virtual Environment"},{"location":"Dev%20Environment%20Setup%20Guide/#api-commands","text":"Command Description gunicorn webqueue2api.api:app This will start a local server on localhost:8000 to access the API. mkdocs serve This will start a local server on localhost:6060 to access the API docs. As you change API documentation files in ./docs/ you'll see your changes in the browser. mkdocs build This will output a static bundle of the API documentation in ./site/ that can be put on any webserver.","title":"API Commands"},{"location":"Installation/","text":"Installation \u2693\ufe0e The webqueue2 API is publicly available at https://engineering.purdue.edu/webqueue/webqueue2/build/api but you can install it on your own machine if you'd like. The code is available on GitHub . Available package versions can be seen on the releases page and can be installed via pip, a requirements file, or downloaded and installed manually. pip available on ECN machines needs updated. Installation via pip is possible through pip's VCS support which was introduced in pip 19. The version of pip available on ECN supported machines is too old and needs updated. To update pip, run: pip install -U pop Using a virtual environment is recommended for reproducibility. Create a virtual environment called __venv__ : python3 -m venv __venv__ Activate the virtual environment: source __venv__/bin/activate Update pip: pip install -U pip Install via pip To install webqueue2-api 1.0.0, you can run: pip install git+https://github.itap.purdue.edu/ECN/webqueue2-api@1.0.0#egg=webqueue2api Install via requirements file To install webqueue2-api 1.0.0, place the following line your requirements file: echo \"git+https://github.itap.purdue.edu/ECN/webqueue2-api@1.0.0#egg=webqueue2api\" >> requirements.txt pip install -r requirements.txt If you'd like a version other than 1.0.0 simply replace the that version number with a different version listed on the releases page . To start the server, run the following while your virtual environment is activated: gunicorn webqueue2api.api:app","title":"Installation"},{"location":"Installation/#installation","text":"The webqueue2 API is publicly available at https://engineering.purdue.edu/webqueue/webqueue2/build/api but you can install it on your own machine if you'd like. The code is available on GitHub . Available package versions can be seen on the releases page and can be installed via pip, a requirements file, or downloaded and installed manually. pip available on ECN machines needs updated. Installation via pip is possible through pip's VCS support which was introduced in pip 19. The version of pip available on ECN supported machines is too old and needs updated. To update pip, run: pip install -U pop Using a virtual environment is recommended for reproducibility. Create a virtual environment called __venv__ : python3 -m venv __venv__ Activate the virtual environment: source __venv__/bin/activate Update pip: pip install -U pip Install via pip To install webqueue2-api 1.0.0, you can run: pip install git+https://github.itap.purdue.edu/ECN/webqueue2-api@1.0.0#egg=webqueue2api Install via requirements file To install webqueue2-api 1.0.0, place the following line your requirements file: echo \"git+https://github.itap.purdue.edu/ECN/webqueue2-api@1.0.0#egg=webqueue2api\" >> requirements.txt pip install -r requirements.txt If you'd like a version other than 1.0.0 simply replace the that version number with a different version listed on the releases page . To start the server, run the following while your virtual environment is activated: gunicorn webqueue2api.api:app","title":"Installation"},{"location":"Material%20for%20mkdocs%20Formatting/","text":"Material for mkdocs Formatting \u2693\ufe0e Admonitions \u2693\ufe0e See: Material for mkdocs: Admonitions Note Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa. Summary Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa. Info Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa. Custom Title Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa. Code Blocks \u2693\ufe0e See: Material for mkdocs: Code Blocks # This is a Python code block. print ( \"Hello world!\" ) if __name__ == \"__main__\" 1 2 # This is a JavaScript code block with line numbers . ( _ => console . log ( \"Hello world!\" ))(); # This is a Markdown code block with line highlights and nested code block. ``` js ( _ => console.log(\"Hello world!\"))(); ``` This is an inline Java highlight system . out . println ( \"Hello world!\" ) Content Tabs \u2693\ufe0e See: Material for mkdocs: Content Tabs Basic Tabs \u2693\ufe0e === \"Tab 1\" Hello === \"Tab 2\" World Tab 1 Hello Tab 2 World Tabs in Admonitions with Code Blocks \u2693\ufe0e !!! example \"Hello world\" in many languages: === \"Python\" ```python print ( \"Hello world!\" ) if __name__ == \"__main__\" ``` === \"JavaScript\" ```js ( _ => console . log ( \"Hello world!\" ))(); ``` Example \"Hello world\" in many languages: Python print ( \"Hello world!\" ) if __name__ == \"__main__\" JavaScript ( _ => console . log ( \"Hello world!\" ))(); Data Tables \u2693\ufe0e See: Material for mkdocs: Data Tables | Method | Description | | ----------- | ------------------------------------ | | `GET` | :material-check: Fetch resource | | `PUT` | :material-check-all: Update resource | | `DELETE` | :material-close: Delete resource | Method Description GET Fetch resource PUT Update resource DELETE Delete resource","title":"Material for mkdocs Formatting"},{"location":"Material%20for%20mkdocs%20Formatting/#material-for-mkdocs-formatting","text":"","title":"Material for mkdocs Formatting"},{"location":"Material%20for%20mkdocs%20Formatting/#admonitions","text":"See: Material for mkdocs: Admonitions Note Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa. Summary Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa. Info Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa. Custom Title Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.","title":"Admonitions"},{"location":"Material%20for%20mkdocs%20Formatting/#code-blocks","text":"See: Material for mkdocs: Code Blocks # This is a Python code block. print ( \"Hello world!\" ) if __name__ == \"__main__\" 1 2 # This is a JavaScript code block with line numbers . ( _ => console . log ( \"Hello world!\" ))(); # This is a Markdown code block with line highlights and nested code block. ``` js ( _ => console.log(\"Hello world!\"))(); ``` This is an inline Java highlight system . out . println ( \"Hello world!\" )","title":"Code Blocks"},{"location":"Material%20for%20mkdocs%20Formatting/#content-tabs","text":"See: Material for mkdocs: Content Tabs","title":"Content Tabs"},{"location":"Material%20for%20mkdocs%20Formatting/#basic-tabs","text":"=== \"Tab 1\" Hello === \"Tab 2\" World Tab 1 Hello Tab 2 World","title":"Basic Tabs"},{"location":"Material%20for%20mkdocs%20Formatting/#tabs-in-admonitions-with-code-blocks","text":"!!! example \"Hello world\" in many languages: === \"Python\" ```python print ( \"Hello world!\" ) if __name__ == \"__main__\" ``` === \"JavaScript\" ```js ( _ => console . log ( \"Hello world!\" ))(); ``` Example \"Hello world\" in many languages: Python print ( \"Hello world!\" ) if __name__ == \"__main__\" JavaScript ( _ => console . log ( \"Hello world!\" ))();","title":"Tabs in Admonitions with Code Blocks"},{"location":"Material%20for%20mkdocs%20Formatting/#data-tables","text":"See: Material for mkdocs: Data Tables | Method | Description | | ----------- | ------------------------------------ | | `GET` | :material-check: Fetch resource | | `PUT` | :material-check-all: Update resource | | `DELETE` | :material-close: Delete resource | Method Description GET Fetch resource PUT Update resource DELETE Delete resource","title":"Data Tables"},{"location":"api/Authentication/","text":"Authentication \u2693\ufe0e The webqueue2 API uses a two stage authentication system combining Active Directory and HTTP Token (or \"bearer\") authentication. Getting an Access Token \u2693\ufe0e All API calls require an access token. You can get an access token by making a POST request to the /api/login endpoint containing the JSON encoded username and password of a valid user. Who is a valid user? A valid user is a non-admin BoilerAD user who is in the 00000227-ECN-webqueue group. Users cannot be added directly to this group. To be included in this group, a user must exist in one of the following groups: 00000227-ECNStaff 00000227-ECNStuds 00000227-ECN-webqueue-misc Example \u2693\ufe0e Get an access token. fetch ( \"https://engineering.purdue.edu/webqueue/webqueue2/build/api/login\" , { method : \"POST\" , headers : { 'Content-Type' : 'application/json' }, body : JSON . stringify ({ \"username\" : USERNAME , \"password\" : PASSWORD }) } ) . then ( resp => resp . json () ) . then ( data => console . log ( data . access_token )) // Expected Output \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ.6z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE\" Making Calls With Access Token \u2693\ufe0e To interact with the API, add an Authorization header to your request with a value of Bearer TOKEN where TOKEN is your access token. Example: \u2693\ufe0e Get item CE 100. let access_token = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ.6z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE\" ; let queue = \"ce\" ; let item_number = 100 ; fetch ( `https://engineering.purdue.edu/webqueue/webqueue2/build/api/data/ ${ queue } / ${ item_number } ` , { headers : { \"Authorization\" : `Bearer ${ access_token } ` }} ) . then ( resp => resp . json () ) . then ( data => console . log ( data )); // Expected Output { queue : \"ce\" , number : 100 , lastUpdated : \"2021-03-11T07:24:00-0500\" ... } Refreshing Access Tokens \u2693\ufe0e When you login, you'll receive an access token that expires 15 minutes after creation as well as two cookies needed to get a new access token. Those cookies are: Name Value Path Expiration SameSite refresh_token_cookie Your refresh token. /api/tokens/refresh 30 Days Yes csrf_refresh_token Additional verification data. (e.g. 7b7c1ea8-f6bb-4204-99af-cd4124a69d89 ) / Session Yes The refresh_token_cookie is used to generate a new access token and will be sent back to the server with every request automatically. It expires 30 days after login. The csrf_refresh_token is used to verify the refresh_token_cookie and needs sent back as an X-CSRF-TOKEN header. To refresh your access token, make a POST request to the /api/tokens/refresh endpoint with the value of the csrf_refresh_token cookies inside a X-CSRF-TOKEN header: Example \u2693\ufe0e Get a new refresh token. // Get this value from your cookies. const csrf_refresh_token = \"7b7c1ea8-f6bb-4204-99af-cd4124a69d89\" fetch ( `https://engineering.purdue.edu/webqueue/webqueue2/build/api/tokens/refresh` , { method : \"POST\" , headers : { 'X-CSRF-TOKEN' : csrf_refresh_token } } ) . then ( resp => resp . json () ) . then ( data => console . log ( data . access_token )); // Expected Output eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9 . eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ .6 z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE","title":"Authentication"},{"location":"api/Authentication/#authentication","text":"The webqueue2 API uses a two stage authentication system combining Active Directory and HTTP Token (or \"bearer\") authentication.","title":"Authentication"},{"location":"api/Authentication/#getting-an-access-token","text":"All API calls require an access token. You can get an access token by making a POST request to the /api/login endpoint containing the JSON encoded username and password of a valid user. Who is a valid user? A valid user is a non-admin BoilerAD user who is in the 00000227-ECN-webqueue group. Users cannot be added directly to this group. To be included in this group, a user must exist in one of the following groups: 00000227-ECNStaff 00000227-ECNStuds 00000227-ECN-webqueue-misc","title":"Getting an Access Token"},{"location":"api/Authentication/#example","text":"Get an access token. fetch ( \"https://engineering.purdue.edu/webqueue/webqueue2/build/api/login\" , { method : \"POST\" , headers : { 'Content-Type' : 'application/json' }, body : JSON . stringify ({ \"username\" : USERNAME , \"password\" : PASSWORD }) } ) . then ( resp => resp . json () ) . then ( data => console . log ( data . access_token )) // Expected Output \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ.6z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE\"","title":"Example"},{"location":"api/Authentication/#making-calls-with-access-token","text":"To interact with the API, add an Authorization header to your request with a value of Bearer TOKEN where TOKEN is your access token.","title":"Making Calls With Access Token"},{"location":"api/Authentication/#example_1","text":"Get item CE 100. let access_token = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ.6z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE\" ; let queue = \"ce\" ; let item_number = 100 ; fetch ( `https://engineering.purdue.edu/webqueue/webqueue2/build/api/data/ ${ queue } / ${ item_number } ` , { headers : { \"Authorization\" : `Bearer ${ access_token } ` }} ) . then ( resp => resp . json () ) . then ( data => console . log ( data )); // Expected Output { queue : \"ce\" , number : 100 , lastUpdated : \"2021-03-11T07:24:00-0500\" ... }","title":"Example:"},{"location":"api/Authentication/#refreshing-access-tokens","text":"When you login, you'll receive an access token that expires 15 minutes after creation as well as two cookies needed to get a new access token. Those cookies are: Name Value Path Expiration SameSite refresh_token_cookie Your refresh token. /api/tokens/refresh 30 Days Yes csrf_refresh_token Additional verification data. (e.g. 7b7c1ea8-f6bb-4204-99af-cd4124a69d89 ) / Session Yes The refresh_token_cookie is used to generate a new access token and will be sent back to the server with every request automatically. It expires 30 days after login. The csrf_refresh_token is used to verify the refresh_token_cookie and needs sent back as an X-CSRF-TOKEN header. To refresh your access token, make a POST request to the /api/tokens/refresh endpoint with the value of the csrf_refresh_token cookies inside a X-CSRF-TOKEN header:","title":"Refreshing Access Tokens"},{"location":"api/Authentication/#example_2","text":"Get a new refresh token. // Get this value from your cookies. const csrf_refresh_token = \"7b7c1ea8-f6bb-4204-99af-cd4124a69d89\" fetch ( `https://engineering.purdue.edu/webqueue/webqueue2/build/api/tokens/refresh` , { method : \"POST\" , headers : { 'X-CSRF-TOKEN' : csrf_refresh_token } } ) . then ( resp => resp . json () ) . then ( data => console . log ( data . access_token )); // Expected Output eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9 . eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ .6 z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE","title":"Example"},{"location":"api/Getting%20Started/","text":"Getting Started \u2693\ufe0e The webqueue2 API is organized around REST . The API has resource oriented URLs, accepts and returns JSON encoded request bodies, can be modified via the query string and uses standard HTTP response codes and verbs. You can use the webqueue2 API hosted at https://engineering.purdue.edu/webqueue/webqueue2/build/api or install it on your own machine . Basic Usage \u2693\ufe0e Get the first item in CE queue. let access_token = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ.6z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE\" ; let queue = \"ce\" ; fetch ( `https://engineering.purdue.edu/webqueue/webqueue2/build/api/data/ ${ queue } ` , { headers : { \"Authorization\" : `Bearer ${ access_token } ` }} ) . then ( resp => resp . json () ) . then ( data => console . log ( data [ 0 ]. items [ 0 ] )); // Expected Output { queue : \"ce\" , number : 17 , lastUpdated : \"2021-03-29T17:12:00-0400\" ... } Get the subject of an CE 1. let access_token = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ.6z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE\" ; let queue = \"ce\" ; let item_number = 1 ; fetch ( `https://engineering.purdue.edu/webqueue/webqueue2/build/api/data/ ${ queue } / ${ item_number } ` , { headers : { \"Authorization\" : `Bearer ${ access_token } ` }} ) . then ( resp => resp . json () ) . then ( data => console . log ( data . subject )); // Expected Output \"Linux Server Purchase\"","title":"Getting Started"},{"location":"api/Getting%20Started/#getting-started","text":"The webqueue2 API is organized around REST . The API has resource oriented URLs, accepts and returns JSON encoded request bodies, can be modified via the query string and uses standard HTTP response codes and verbs. You can use the webqueue2 API hosted at https://engineering.purdue.edu/webqueue/webqueue2/build/api or install it on your own machine .","title":"Getting Started"},{"location":"api/Getting%20Started/#basic-usage","text":"Get the first item in CE queue. let access_token = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ.6z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE\" ; let queue = \"ce\" ; fetch ( `https://engineering.purdue.edu/webqueue/webqueue2/build/api/data/ ${ queue } ` , { headers : { \"Authorization\" : `Bearer ${ access_token } ` }} ) . then ( resp => resp . json () ) . then ( data => console . log ( data [ 0 ]. items [ 0 ] )); // Expected Output { queue : \"ce\" , number : 17 , lastUpdated : \"2021-03-29T17:12:00-0400\" ... } Get the subject of an CE 1. let access_token = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MTY1NTIyMDIsIm5iZiI6MTYxNjU1MjIwMiwianRpIjoiZDgyNGM1MWItM2JmNy00ZDUzLWE0YTgtY2VhZWQ5ZmVjNGYzIiwiZXhwIjoxNjE2NTUzMTAyLCJzdWIiOiJjYW1wYjMwMyIsImZyZXNoIjpmYWxzZSwidHlwZSI6ImFjY2VzcyIsImNzcmYiOiI1Yjk5NWQ5OS05YjIzLTQyMjYtYTc0OC1lMmQ5OTA4MDkzOTQifQ.6z7EReDfhPkBkuAMHEvDuMDV4wVbqrWSjQXdRyv_5hE\" ; let queue = \"ce\" ; let item_number = 1 ; fetch ( `https://engineering.purdue.edu/webqueue/webqueue2/build/api/data/ ${ queue } / ${ item_number } ` , { headers : { \"Authorization\" : `Bearer ${ access_token } ` }} ) . then ( resp => resp . json () ) . then ( data => console . log ( data . subject )); // Expected Output \"Linux Server Purchase\"","title":"Basic Usage"},{"location":"api/Items/","text":"Items \u2693\ufe0e An item is a chronological representation of an interaction with a user. Endpoint \u2693\ufe0e GET /api/data/{queue}/{number} Parameters \u2693\ufe0e Name Value queue The queue of the item. number The number of the item. Query String Options \u2693\ufe0e Name Description Possible Values headers_only When \"True\" , only meta data will be loaded. When \"False\" content will be parsed. (Defaults to \"False\" .) \"True\" | \"False\" Return Codes \u2693\ufe0e Code Description 200 - Ok On success. 404 - Not Found When the Item does not exist. 500 - Internal Service Error On failure. Properties \u2693\ufe0e Item.assigned_to : \u2693\ufe0e Type Description String The Purdue career account alias of the person this item is assigned to. Example console . log ( Item . assigned_to ) // Expexted Output \"sundeep\" Item.building \u2693\ufe0e Type Description String The building a particular Item is related to. Example console . log ( Item . building ) // Expexted Output \"ME\" Item.content \u2693\ufe0e Type Description Array A chronological array of objects representing 1 of 9 possible actions taken on an item. Possible Actions Directory Information Information about the user info collected from ECNDB including but not limited to alias, phone number and office location. Properties Key Value type directory_information Name The real name of the sender. Login The career account alias of the sender. Computer The computer the item is related to. Formatting may vary. Location Where the computer is located. Email The email address of the sender. Phone The phone number of the sender. Office The office location of the sender. UNIX Dir The home directory for the user on non-Windows systems Zero Dir The home directory for the user via Active Directory User ECNDB Link to the sender's username report in ECNDB Host ECNDB Link to the computer report in ECNDB Subject The subject of the email sent to the queue Parsed Example { \"type\" : \"directory_information\" , \"Name\" : \"Nestor Fabian Rodriguez Buitrago\" , \"Login\" : \"rodri563\" , \"Computer\" : \"ce-205-38 (128.46.205.67)\" , \"Location\" : \"HAMP G230\" , \"Email\" : \"rodri563@purdue.edu\" , \"Phone\" : \"7654766893\" , \"Office\" : \"HAMP G230\" , \"UNIX Dir\" : \"/home/bridge/b/rodri563\" , \"Zero Dir\" : \"U=\\\\\\\\bridge.ecn.purdue.edu\\\\rodri563\" , \"User ECNDB\" : \"http://eng.purdue.edu/jump/2e8399a\" , \"Host ECNDB\" : \"http://eng.purdue.edu/jump/2e83999\" , \"Subject\" : \"Autocad installation\" } Initial Message The body of the email the item originated from. Properties Key Value type initial_message datetime RFC 8061 formatted datetime string. from_name The sender's real name. Formatting may vary. This can be empty. from_email The sender's email address. to A list of names(s) and email(s) of people this message was sent to. cc A list of name(s) and email(s) of people who were CC'd. This can be empty. subject The subject of the initial message. content The content of the message as an list of strings. Parsed Example { \"type\" : \"initial_message\" , \"datetime\" : \"2020-09-11T01:26:45+00:00\" , \"from_name\" : \"Justin Campbell\" , \"from_email\" : \"campb303@purdue.edu\" , \"to\" : [ { \"name\" : \"John Doe\" , \"email\" : \"johndoe@example.com\" }, ], \"cc\" : [ { \"name\" : \"\" , \"email\" : \"janesmith@example.com\" } ], \"subject\" : Maps to item . subject , \"content\" : [ \"I need some help with something.\\n\" ] } Edit Information added by someone at ECN, usually for internal use and/or communication. Properties Key Value type edit datetime RFC 8061 formatted datetime string. by The career account alias of the person who added the edit. content The content of the edit as a list of strings. Parsed Example { \"type\" : \"edit\" , \"datetime\" : \"2020-04-22T16:39:51\" , \"by\" : \"knewell\" , \"content\" : [ \"This is related to another item. I need to do X next.\\n\" ] } Status A short message about the progress of the item. Properties Key Value type status datetime RFC 8061 formatted datetime string. by The career account alias of the person who updated the status. content The content of the status as a list of strings. Parsed Example { \"type\" : \"status\" , \"datetime\" : \"2020-04-23T10:35:47\" , \"by\" : \"knewell\" , \"content\" : [ \"Doing X thing.\" ] } Assignment Assigning the item to someone. Properties Key Value type assignment datetime RFC 8061 formatted datetime string. by The career account alias of the person who changed the to The career account alias of the person who the item was assigned to. Parsed Example { \"type\" : \"assignment\" , \"datetime\" : \"2020-06-23T13:27:00\" , \"by\" : \"harley\" , \"to\" : \"campb303\" , } Reply To User A message from ECN to the user and/or related parties. Properties Key Value type reply_to_user datetime RFC 8061 formatted datetime string. by The sender's real name. Formatting may vary. This can be empty. content The content of the message as an list of strings Parsed Example { \"type\" : \"reply_to_user\" , \"datetime\" : \"2020-05-08T09:21:43\" , \"by\" : \"ewhile\" , \"content\" : [ \"Sascha,\\n\" , \"\\n\" , \"Chicken kevin biltong, flank jowl prosciutto shoulder meatball meatloaf sirloin.\\n\" , \"\\n\" , \"Ethan White\\n\" , \"ECN\" ] } Reply To User A message from ECN to the user and/or related parties. Properties Key Value type reply_to_user datetime RFC 8061 formatted datetime string. by The sender's real name. Formatting may vary. This can be empty. content The content of the message as an list of strings Parsed Example { \"type\" : \"reply_to_user\" , \"datetime\" : \"2020-05-08T09:21:43\" , \"by\" : \"ewhile\" , \"content\" : [ \"Sascha,\\n\" , \"\\n\" , \"Chicken kevin biltong, flank jowl prosciutto shoulder meatball meatloaf sirloin.\\n\" , \"\\n\" , \"Ethan White\\n\" , \"ECN\" ] } Reply From User A message from the user and/or related parties. Properties Key Value type reply_from_user datetime RFC 8061 formatted datetime string. from_name The sender's real name. Formatting may vary. This can be empty. from_email The sender's email address. cc A list of name(s) and email(s) of people who were CC'd. This can be empty. headers A dictionary of headers from the reply. subject The subject of the reply. content The content of the message as an list of strings Parsed Example { \"type\" : \"reply_from_user\" , \"datetime\" : \"2020-05-08T13:57:18+00:00\" , \"from_name\" : \"Reckowsky, Michael J.\" , \"from_email\" : \"mreckowsky@purdue.edu\" , \"cc\" : [ { \"name\" : \"John Doe\" , \"email\" : \"johndoe@example.com\" }, { \"name\" : \"\" , \"email\" : \"janesmith@example.com\" } ], \"headers\" : [ { \"type\" : \"Subject\" , \"content\" : \"RE: New Computer Deploy\" }, { \"type\" : \"From\" , \"content\" : \"\\\"Reckowsky, Michael J.\\\" \" }, { \"type\" : \"Date\" , \"content\" : \"Fri, 8 May 2020 13:57:17 +0000\" }, ], \"subject\" : \"RE: New Computer Deploy\" , \"content\" : [ \"Ethan,\\n\" , \"\\n\" , \"Biltong beef ribs doner chuck, pork chop jowl salami cow filet mignon pork.\\n\" , \"\\n\" , \"Mike\\n\" , ] } Parse Error An error caused by a malformed delimiter or nested delimiters. Properties Key Value type parse_error datetime RFC 8061 formatted datetime string. file_path Full path of the item with the error. expected Description of what the parser was expecting. got Line that cause the parse error. line_num The line number in the item that caused the parse error. Parsed Example { 'type' : 'parse_error' , 'datetime' : '2020-10-16T10:44:45' , 'file_path' : '/home/pier/e/benne238/webqueue2/q-snapshot/aae/2' , 'expected' : 'Did not encounter a reply-from-user ending delimiter' , 'got' : 'Kris' , 'line_num' : 468 } Item.date_received \u2693\ufe0e Type Description String An ISO 8601 formatted time string showing the date this item was created. Example console . log ( Item . date_received ) // Expexted Output \"2021-04-03T00:48:38+00:00\" Item.department \u2693\ufe0e Type Description String The most recent department for this item. Example console . log ( Item . department ) // Expexted Output \"Bussiness Office\" Item.headers \u2693\ufe0e Type Description Array An array of objects containing parsed item headers in type / value pairs. Example console . log ( Item . headers [ 0 ]) // Expexted Output { type : \"From\" , content : \"\\\"Campbell, Justin Tyler\\\" \\n\" } Item.is_locked \u2693\ufe0e Type Description Boolean A boolean showing whether or not a lockfile for the item is present. Example console . log ( Item . is_locked ) // Expexted Output true Item.last_updated \u2693\ufe0e Type Description String An ISO 8601 formatted time string showing the last time the file was updated according to the filesystem. Example console . log ( Item . last_updated ) // Expected Output \"2021-04-03T00:48:38+00:00\" Item.number \u2693\ufe0e Type Description Number The indentifying number of the queue item. Example console . log ( Item . number ) // Expected Output 4 Item.path \u2693\ufe0e Type Description String The absolute file path to the Item. Example console . log ( Item . path ) // Expected Output \"/home/pier/e/queue/Mail/ce/1\" Item.priority: \u2693\ufe0e Type Description String The most recent priority for this item. Example console . log ( Item . priority ) // Expexted Output \"COVID\" Item.queue: \u2693\ufe0e Type Description String The queue the Item is in. Example console . log ( Item . queue ) // Expexted Output \"ce\" Item.status \u2693\ufe0e Type Description String The most recent status update for the item. Example console . log ( Item . status ) // Expexted Output \"Waiting for Reply\" Item.subject: \u2693\ufe0e Type Description String The subject of the original message for this item. Example console . log ( Item . subject ) // Expexted Output \"Can't Access Outlook\" Item.user_alias : \u2693\ufe0e Type Description String The Purdue career account alias of the person this item is from. Example console . log ( Item . user_alias ) // Expexted Output \"campb303\" Item.user_email \u2693\ufe0e Type Description String The email address of the person who this item is from. Example console . log ( Item . user_email ) // Expexted Output \"campb303@purdue.edu\" Item.user_name \u2693\ufe0e Type Description String The real name of the person who this item is from. Example console . log ( Item . user_name ) // Expexted Output \"Justin Campbell\"","title":"Items"},{"location":"api/Items/#items","text":"An item is a chronological representation of an interaction with a user.","title":"Items"},{"location":"api/Items/#endpoint","text":"GET /api/data/{queue}/{number}","title":"Endpoint"},{"location":"api/Items/#parameters","text":"Name Value queue The queue of the item. number The number of the item.","title":"Parameters"},{"location":"api/Items/#query-string-options","text":"Name Description Possible Values headers_only When \"True\" , only meta data will be loaded. When \"False\" content will be parsed. (Defaults to \"False\" .) \"True\" | \"False\"","title":"Query String Options"},{"location":"api/Items/#return-codes","text":"Code Description 200 - Ok On success. 404 - Not Found When the Item does not exist. 500 - Internal Service Error On failure.","title":"Return Codes"},{"location":"api/Items/#properties","text":"","title":"Properties"},{"location":"api/Items/#itemassigned_to","text":"Type Description String The Purdue career account alias of the person this item is assigned to. Example console . log ( Item . assigned_to ) // Expexted Output \"sundeep\"","title":"Item.assigned_to:"},{"location":"api/Items/#itembuilding","text":"Type Description String The building a particular Item is related to. Example console . log ( Item . building ) // Expexted Output \"ME\"","title":"Item.building"},{"location":"api/Items/#itemcontent","text":"Type Description Array A chronological array of objects representing 1 of 9 possible actions taken on an item. Possible Actions Directory Information Information about the user info collected from ECNDB including but not limited to alias, phone number and office location. Properties Key Value type directory_information Name The real name of the sender. Login The career account alias of the sender. Computer The computer the item is related to. Formatting may vary. Location Where the computer is located. Email The email address of the sender. Phone The phone number of the sender. Office The office location of the sender. UNIX Dir The home directory for the user on non-Windows systems Zero Dir The home directory for the user via Active Directory User ECNDB Link to the sender's username report in ECNDB Host ECNDB Link to the computer report in ECNDB Subject The subject of the email sent to the queue Parsed Example { \"type\" : \"directory_information\" , \"Name\" : \"Nestor Fabian Rodriguez Buitrago\" , \"Login\" : \"rodri563\" , \"Computer\" : \"ce-205-38 (128.46.205.67)\" , \"Location\" : \"HAMP G230\" , \"Email\" : \"rodri563@purdue.edu\" , \"Phone\" : \"7654766893\" , \"Office\" : \"HAMP G230\" , \"UNIX Dir\" : \"/home/bridge/b/rodri563\" , \"Zero Dir\" : \"U=\\\\\\\\bridge.ecn.purdue.edu\\\\rodri563\" , \"User ECNDB\" : \"http://eng.purdue.edu/jump/2e8399a\" , \"Host ECNDB\" : \"http://eng.purdue.edu/jump/2e83999\" , \"Subject\" : \"Autocad installation\" } Initial Message The body of the email the item originated from. Properties Key Value type initial_message datetime RFC 8061 formatted datetime string. from_name The sender's real name. Formatting may vary. This can be empty. from_email The sender's email address. to A list of names(s) and email(s) of people this message was sent to. cc A list of name(s) and email(s) of people who were CC'd. This can be empty. subject The subject of the initial message. content The content of the message as an list of strings. Parsed Example { \"type\" : \"initial_message\" , \"datetime\" : \"2020-09-11T01:26:45+00:00\" , \"from_name\" : \"Justin Campbell\" , \"from_email\" : \"campb303@purdue.edu\" , \"to\" : [ { \"name\" : \"John Doe\" , \"email\" : \"johndoe@example.com\" }, ], \"cc\" : [ { \"name\" : \"\" , \"email\" : \"janesmith@example.com\" } ], \"subject\" : Maps to item . subject , \"content\" : [ \"I need some help with something.\\n\" ] } Edit Information added by someone at ECN, usually for internal use and/or communication. Properties Key Value type edit datetime RFC 8061 formatted datetime string. by The career account alias of the person who added the edit. content The content of the edit as a list of strings. Parsed Example { \"type\" : \"edit\" , \"datetime\" : \"2020-04-22T16:39:51\" , \"by\" : \"knewell\" , \"content\" : [ \"This is related to another item. I need to do X next.\\n\" ] } Status A short message about the progress of the item. Properties Key Value type status datetime RFC 8061 formatted datetime string. by The career account alias of the person who updated the status. content The content of the status as a list of strings. Parsed Example { \"type\" : \"status\" , \"datetime\" : \"2020-04-23T10:35:47\" , \"by\" : \"knewell\" , \"content\" : [ \"Doing X thing.\" ] } Assignment Assigning the item to someone. Properties Key Value type assignment datetime RFC 8061 formatted datetime string. by The career account alias of the person who changed the to The career account alias of the person who the item was assigned to. Parsed Example { \"type\" : \"assignment\" , \"datetime\" : \"2020-06-23T13:27:00\" , \"by\" : \"harley\" , \"to\" : \"campb303\" , } Reply To User A message from ECN to the user and/or related parties. Properties Key Value type reply_to_user datetime RFC 8061 formatted datetime string. by The sender's real name. Formatting may vary. This can be empty. content The content of the message as an list of strings Parsed Example { \"type\" : \"reply_to_user\" , \"datetime\" : \"2020-05-08T09:21:43\" , \"by\" : \"ewhile\" , \"content\" : [ \"Sascha,\\n\" , \"\\n\" , \"Chicken kevin biltong, flank jowl prosciutto shoulder meatball meatloaf sirloin.\\n\" , \"\\n\" , \"Ethan White\\n\" , \"ECN\" ] } Reply To User A message from ECN to the user and/or related parties. Properties Key Value type reply_to_user datetime RFC 8061 formatted datetime string. by The sender's real name. Formatting may vary. This can be empty. content The content of the message as an list of strings Parsed Example { \"type\" : \"reply_to_user\" , \"datetime\" : \"2020-05-08T09:21:43\" , \"by\" : \"ewhile\" , \"content\" : [ \"Sascha,\\n\" , \"\\n\" , \"Chicken kevin biltong, flank jowl prosciutto shoulder meatball meatloaf sirloin.\\n\" , \"\\n\" , \"Ethan White\\n\" , \"ECN\" ] } Reply From User A message from the user and/or related parties. Properties Key Value type reply_from_user datetime RFC 8061 formatted datetime string. from_name The sender's real name. Formatting may vary. This can be empty. from_email The sender's email address. cc A list of name(s) and email(s) of people who were CC'd. This can be empty. headers A dictionary of headers from the reply. subject The subject of the reply. content The content of the message as an list of strings Parsed Example { \"type\" : \"reply_from_user\" , \"datetime\" : \"2020-05-08T13:57:18+00:00\" , \"from_name\" : \"Reckowsky, Michael J.\" , \"from_email\" : \"mreckowsky@purdue.edu\" , \"cc\" : [ { \"name\" : \"John Doe\" , \"email\" : \"johndoe@example.com\" }, { \"name\" : \"\" , \"email\" : \"janesmith@example.com\" } ], \"headers\" : [ { \"type\" : \"Subject\" , \"content\" : \"RE: New Computer Deploy\" }, { \"type\" : \"From\" , \"content\" : \"\\\"Reckowsky, Michael J.\\\" \" }, { \"type\" : \"Date\" , \"content\" : \"Fri, 8 May 2020 13:57:17 +0000\" }, ], \"subject\" : \"RE: New Computer Deploy\" , \"content\" : [ \"Ethan,\\n\" , \"\\n\" , \"Biltong beef ribs doner chuck, pork chop jowl salami cow filet mignon pork.\\n\" , \"\\n\" , \"Mike\\n\" , ] } Parse Error An error caused by a malformed delimiter or nested delimiters. Properties Key Value type parse_error datetime RFC 8061 formatted datetime string. file_path Full path of the item with the error. expected Description of what the parser was expecting. got Line that cause the parse error. line_num The line number in the item that caused the parse error. Parsed Example { 'type' : 'parse_error' , 'datetime' : '2020-10-16T10:44:45' , 'file_path' : '/home/pier/e/benne238/webqueue2/q-snapshot/aae/2' , 'expected' : 'Did not encounter a reply-from-user ending delimiter' , 'got' : 'Kris' , 'line_num' : 468 }","title":"Item.content"},{"location":"api/Items/#itemdate_received","text":"Type Description String An ISO 8601 formatted time string showing the date this item was created. Example console . log ( Item . date_received ) // Expexted Output \"2021-04-03T00:48:38+00:00\"","title":"Item.date_received"},{"location":"api/Items/#itemdepartment","text":"Type Description String The most recent department for this item. Example console . log ( Item . department ) // Expexted Output \"Bussiness Office\"","title":"Item.department"},{"location":"api/Items/#itemheaders","text":"Type Description Array An array of objects containing parsed item headers in type / value pairs. Example console . log ( Item . headers [ 0 ]) // Expexted Output { type : \"From\" , content : \"\\\"Campbell, Justin Tyler\\\" \\n\" }","title":"Item.headers"},{"location":"api/Items/#itemis_locked","text":"Type Description Boolean A boolean showing whether or not a lockfile for the item is present. Example console . log ( Item . is_locked ) // Expexted Output true","title":"Item.is_locked"},{"location":"api/Items/#itemlast_updated","text":"Type Description String An ISO 8601 formatted time string showing the last time the file was updated according to the filesystem. Example console . log ( Item . last_updated ) // Expected Output \"2021-04-03T00:48:38+00:00\"","title":"Item.last_updated"},{"location":"api/Items/#itemnumber","text":"Type Description Number The indentifying number of the queue item. Example console . log ( Item . number ) // Expected Output 4","title":"Item.number"},{"location":"api/Items/#itempath","text":"Type Description String The absolute file path to the Item. Example console . log ( Item . path ) // Expected Output \"/home/pier/e/queue/Mail/ce/1\"","title":"Item.path"},{"location":"api/Items/#itempriority","text":"Type Description String The most recent priority for this item. Example console . log ( Item . priority ) // Expexted Output \"COVID\"","title":"Item.priority:"},{"location":"api/Items/#itemqueue","text":"Type Description String The queue the Item is in. Example console . log ( Item . queue ) // Expexted Output \"ce\"","title":"Item.queue:"},{"location":"api/Items/#itemstatus","text":"Type Description String The most recent status update for the item. Example console . log ( Item . status ) // Expexted Output \"Waiting for Reply\"","title":"Item.status"},{"location":"api/Items/#itemsubject","text":"Type Description String The subject of the original message for this item. Example console . log ( Item . subject ) // Expexted Output \"Can't Access Outlook\"","title":"Item.subject:"},{"location":"api/Items/#itemuser_alias","text":"Type Description String The Purdue career account alias of the person this item is from. Example console . log ( Item . user_alias ) // Expexted Output \"campb303\"","title":"Item.user_alias:"},{"location":"api/Items/#itemuser_email","text":"Type Description String The email address of the person who this item is from. Example console . log ( Item . user_email ) // Expexted Output \"campb303@purdue.edu\"","title":"Item.user_email"},{"location":"api/Items/#itemuser_name","text":"Type Description String The real name of the person who this item is from. Example console . log ( Item . user_name ) // Expexted Output \"Justin Campbell\"","title":"Item.user_name"},{"location":"api/Queues/","text":"Queues \u2693\ufe0e A collection of Items . Endpoint \u2693\ufe0e GET /api/data/{queue} Parameters \u2693\ufe0e Name Value queue The name of the queue. Query String Options \u2693\ufe0e Name Description Possible Values headers_only When \"True\" , only meta data will be loaded. When \"False\" content will be parsed. (Defaults to \"True\" .) \"True\" | \"True\" Return Codes \u2693\ufe0e Code Description 200 - Ok On success. 404 - Not Found When the Queue does not exist. 500 - Internal Service Error On failure. Properties \u2693\ufe0e Queue.name \u2693\ufe0e Type Description String The name of the queue. Example console . log ( Queue . name ) // Expected Output \"ce\" Queue.path \u2693\ufe0e Type Description String The absolute file path to the Queue. Example console . log ( Queue . path ) // Expected Output \"/home/pier/e/queue/Mail/ce\" Queue.items \u2693\ufe0e Type Description Array The Items in the queue. Example console . log ( Queue . items ) // Expected Output [ { queue : \"ce\" , number : 01 , lastUpdated : \"2021-03-26T17:12:00-0400\" ... } { queue : \"ce\" , number : 02 , lastUpdated : \"2021-05-29T17:12:00-0400\" ... } { queue : \"ce\" , number : 03 , lastUpdated : \"2020-12-29T17:12:00-0400\" ... } ]","title":"Queues"},{"location":"api/Queues/#queues","text":"A collection of Items .","title":"Queues"},{"location":"api/Queues/#endpoint","text":"GET /api/data/{queue}","title":"Endpoint"},{"location":"api/Queues/#parameters","text":"Name Value queue The name of the queue.","title":"Parameters"},{"location":"api/Queues/#query-string-options","text":"Name Description Possible Values headers_only When \"True\" , only meta data will be loaded. When \"False\" content will be parsed. (Defaults to \"True\" .) \"True\" | \"True\"","title":"Query String Options"},{"location":"api/Queues/#return-codes","text":"Code Description 200 - Ok On success. 404 - Not Found When the Queue does not exist. 500 - Internal Service Error On failure.","title":"Return Codes"},{"location":"api/Queues/#properties","text":"","title":"Properties"},{"location":"api/Queues/#queuename","text":"Type Description String The name of the queue. Example console . log ( Queue . name ) // Expected Output \"ce\"","title":"Queue.name"},{"location":"api/Queues/#queuepath","text":"Type Description String The absolute file path to the Queue. Example console . log ( Queue . path ) // Expected Output \"/home/pier/e/queue/Mail/ce\"","title":"Queue.path"},{"location":"api/Queues/#queueitems","text":"Type Description Array The Items in the queue. Example console . log ( Queue . items ) // Expected Output [ { queue : \"ce\" , number : 01 , lastUpdated : \"2021-03-26T17:12:00-0400\" ... } { queue : \"ce\" , number : 02 , lastUpdated : \"2021-05-29T17:12:00-0400\" ... } { queue : \"ce\" , number : 03 , lastUpdated : \"2020-12-29T17:12:00-0400\" ... } ]","title":"Queue.items"},{"location":"webqueue2api%20Package/Getting%20Started/","text":"Getting Started \u2693\ufe0e The webqueue2api Package provides both a parser to read data from ECN's queue and allow for programatic data access as well as an WSGI application to serve the webqueue2 API. The webqueue2api Package has the following structure: webqueue2api : Contains global configuration and exports utilities/data classes. parser : Contains classes for reading data from queue text files and making it available via objects. api : Contains a WSGI application to host a RESTful API that relies on parser . Basic Usage \u2693\ufe0e Load a queue and get the number of items in it. import webqueue2api ce_queue = webqueue2api . Queue ( \"ce\" ) print ( len ( ce_queue . items ) ) # Expected Output 29 Load an item and get its subject. import webqueue2api ce_1 = webqueue2api . Item ( \"ce\" , 1 ) print ( len ( ce_1 . subject ) ) # Expected Output \"Re: Battery Replacement\"","title":"Getting Started"},{"location":"webqueue2api%20Package/Getting%20Started/#getting-started","text":"The webqueue2api Package provides both a parser to read data from ECN's queue and allow for programatic data access as well as an WSGI application to serve the webqueue2 API. The webqueue2api Package has the following structure: webqueue2api : Contains global configuration and exports utilities/data classes. parser : Contains classes for reading data from queue text files and making it available via objects. api : Contains a WSGI application to host a RESTful API that relies on parser .","title":"Getting Started"},{"location":"webqueue2api%20Package/Getting%20Started/#basic-usage","text":"Load a queue and get the number of items in it. import webqueue2api ce_queue = webqueue2api . Queue ( \"ce\" ) print ( len ( ce_queue . items ) ) # Expected Output 29 Load an item and get its subject. import webqueue2api ce_1 = webqueue2api . Item ( \"ce\" , 1 ) print ( len ( ce_1 . subject ) ) # Expected Output \"Re: Battery Replacement\"","title":"Basic Usage"},{"location":"webqueue2api%20Package/Package%20Structure/","text":"Hierarchy \u2693\ufe0e The webqueue2api Package consists of four packages in total: webqueue2api : The root packages. This contains both the api and the parser packages as well as global configuration. api : Contains a Flask app that can be used with any WSGI server to host the webqueue2 API and utilities such as authentication code. resources : Contains Flask-RESTful resources for the webqueue2 API. parser : Contains parers for a Queue and an Item as well as utilities and custom errors. Configuration \u2693\ufe0e Each package contains package level configuration objects (see: dataclasses on PyPI ) in config.py files. All of the configurations are combined into the top level webqueue2api.config symbol. These configuration objects store default values for each package. Default values can be changed by editing these objects directly or by editing the object values before their use. Changing the parser's queue directory by editing object values. import webqueue2api # Load Queue from default directory ce_queue = Queue ( \"ce\" ) # load Queue from modified directory webqueue2api . config . parser . queue_directory = \"/absolute/path\" other_queue = Queue ( \"other\" )","title":"Package Structure"},{"location":"webqueue2api%20Package/Package%20Structure/#hierarchy","text":"The webqueue2api Package consists of four packages in total: webqueue2api : The root packages. This contains both the api and the parser packages as well as global configuration. api : Contains a Flask app that can be used with any WSGI server to host the webqueue2 API and utilities such as authentication code. resources : Contains Flask-RESTful resources for the webqueue2 API. parser : Contains parers for a Queue and an Item as well as utilities and custom errors.","title":"Hierarchy"},{"location":"webqueue2api%20Package/Package%20Structure/#configuration","text":"Each package contains package level configuration objects (see: dataclasses on PyPI ) in config.py files. All of the configurations are combined into the top level webqueue2api.config symbol. These configuration objects store default values for each package. Default values can be changed by editing these objects directly or by editing the object values before their use. Changing the parser's queue directory by editing object values. import webqueue2api # Load Queue from default directory ce_queue = Queue ( \"ce\" ) # load Queue from modified directory webqueue2api . config . parser . queue_directory = \"/absolute/path\" other_queue = Queue ( \"other\" )","title":"Configuration"}]} \ No newline at end of file diff --git a/docs/sitemap.xml.gz b/docs/sitemap.xml.gz index 31e9b8b2c0d6b379fce9de5ff47ea6ef326d14fc..149c6f5d90efb844af94e70ba618aab6d2e1b296 100644 GIT binary patch delta 15 WcmaFQ^qz@LzMF$1ID8{pCL;hShy-o` delta 15 WcmaFQ^qz@LzMF&Nt=~qrOhy1J_XPg{ diff --git a/setup.py b/setup.py index 42a29bf..5dbb036 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ def get_all_dependencies(): setup( name="webqueue2api", - version="0.9.1", + version="1.0.0", description="A library for managing Purdue ECN's queue system.", python_requires='>=3.6', packages=find_packages(where="src"),