Oracle by Example brandingDeploy an Application by Using the Command-Line Interface

section 0Before 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?


section 1Download the CLI

  1. 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, use apaas.europe.oraclecloud.com.
  2. Open a command-line window or terminal in Linux.
  3. Send a request to the URL.

    https://<rest-server>/paas/core/api/v1.1/cli/<identity-domain>/client

    Provide 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 
  4. Save the psmcli.zip file in your local system.

section 2Install the CLI

  1. If your machine requires a proxy server to connect to the internet, set the http_proxy and https_proxy environment 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 
  2. 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 

section 3Configure the CLI

  1. In the command-line window or terminal in Linux, run the setup command.
    psm setup
  2. Enter your cloud user name, password, and identity domain.
  3. 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 enter emea. Otherwise accept the default value, us.
  4. 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.

section 4Deploy an Application to Oracle Application Container Cloud Service

  1. 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
  2. Check the deployment job status and replace the job-ID placeholder with your job ID.
    psm accs operation-status -j job-ID -of json
  3. Get the application information. Make a note of the URL. You'll use it in the next step.
    psm accs check-health -n HelloWorldApp
  4. Access the application URL and replace the url-app placeholder with your URL.
    curl url-app/myapp/myresource 

more informationWant to Learn More?

PaaS Service Manager Command Line Interface Reference in the Oracle Help Center.