Before You Begin
This 15-minute tutorial shows you how to deploy an application to Oracle Application Container Cloud Service by using the command-line interface (CLI).
Background
Oracle Platform as a Service (PaaS) Service Manager provides a CLI with which you can manage the life cycle of various services in Oracle Cloud Infrastructure.
The CLI is a thin wrapper over PaaS REST APIs. It invokes these APIs to support common PaaS features; for example, creating and managing instances for Oracle Java Cloud Service, Oracle Database Cloud Service instances, and Oracle MySQL Cloud Service or creating and managing applications with Oracle Application Container Cloud Service. The CLI also supports Oracle Cloud Stack Manager, a PaaS tool that automates the provisioning and deletion of cloud environments.
What Do You Need?
- Access to an instance of Oracle Application Container Cloud Service
- Python 3.6+
- cURL 7.0+ with Secure Sockets Layer (SSL) support
- Hello World application archive hello-world-app.zip
Download the CLI
- Identify your REST API server name. If you sign in to your Oracle cloud account through a US data center, use
apaas.us.oraclecloud.com.Otherwise, useapaas.europe.oraclecloud.com. - Open a command-line window or terminal in Linux.
- Send a request to the URL.
https://<rest-server>/paas/core/api/v1.1/cli/<identity-domain>/clientProvide the server name, user name, password, and identity domain in the cURL command.
curl -X GET -u username:password -H X-ID-TENANT-NAME:identity-domain https://server-name.us.oraclecloud.com/paas/core/api/v1.1/cli/identity-domain/client -o psmcli.zip - Save the
psmcli.zipfile in your local system.
Install the CLI
- If your machine requires a proxy server to connect to the internet, set the
http_proxyandhttps_proxyenvironment variables.- Windows example:
set http_proxy=http://myproxy.oracle.com:80 set https_proxy=https://myproxy.oracle.com:80 - Linux example:
export http_proxy=http://myproxy.oracle.com:80 export https_proxy=https://myproxy.oracle.com:80
- Windows example:
- In the command-line window, install CLI as a Python package.
- Windows:
pip3 install -U psmcli.zip - Linux:
sudo —H pip3 install -U psmcli.zip
- Windows:
Configure the CLI
- In the command-line window or terminal in Linux, run the
setupcommand.psm setup - Enter your cloud user name, password, and identity domain.
- Enter your cloud data center region based on the REST API server that you identified earlier. If your REST API server contains the text
emea, then enteremea.Otherwise accept the default value,us. - In the output format field, accept the default value. After the CLI successfully connects to the Oracle cloud, it lists the available services for this cloud account.
Deploy an Application to Oracle Application Container Cloud Service
- In the command-line window, deploy the
HelloWorldApp.Make a note of the job ID. You'll use it in the next step.psm accs push -n HelloWorldApp -r java -s hourly -p hello-world-app.zip - Check the deployment job status and replace the
job-IDplaceholder with your job ID.psm accs operation-status -j job-ID -of json - Get the application information. Make a note of the URL. You'll use it in the next step.
psm accs check-health -n HelloWorldApp - Access the application URL and replace the
url-appplaceholder with your URL.curl url-app/myapp/myresource
Want to Learn More?
PaaS Service Manager Command Line Interface Reference in the Oracle Help Center.
Deploy an Application by Using the Command-Line Interface