Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add two new actions 'info' and 'list' with an optional quiet mode #11

Closed
wants to merge 1 commit into from

Commits on May 13, 2019

  1. Add two new actions 'info' and 'list' with an optional quiet mode

    The 'info' action with the 'quiet' mode enabled:
      psu -a info -u admin -p password -l http://portainer.local -n mystack
    Output the JSON object of the stack if it's already deployed:
    {
      "Id": "mystack_jpofkc0i9uo9wtx1zesuk649w",
      "Name": "mystack",
      "Type": "1",
      "EndpointID": "1",
      "EntryPoint": "docker-compose.yml",
      "SwarmID": "jpofkc0i9uo9wtx1zesuk649w",
      "ProjectPath": "/data/compose/mystack_jpofkc0i9uo9wtx1zesuk649w",
      "Env": [
        {
          "name": "MYSQL_ROOT_PASSWORD",
          "value": "password"
        }
      ]
    }
    
    The 'info' action with the 'quiet' mode enabled:
      psu -a info -u admin -p password -l http://portainer.local -n mystack -q
    Output the stack name if it's already deployed:
      mystack
    
    The 'list' action with the 'quiet' mode enabled:
      psu -a list -u admin -p password -l http://portainer.local
    Output a JSON array of the stacks already deployed:
    [
      {
        "Id": "mystack_jpofkc0i9uo9wtx1zesuk649w",
        "Name": "mystack",
        "Type": "1",
        "EndpointID": "1",
        "EntryPoint": "docker-compose.yml",
        "SwarmID": "jpofkc0i9uo9wtx1zesuk649w",
        "ProjectPath": "/data/compose/mystack_jpofkc0i9uo9wtx1zesuk649w",
        "Env": [
          {
            "name": "MYSQL_ROOT_PASSWORD",
            "value": "password"
          }
        ]
      },
      {
        "Id": "mysecondstack_i0649w9uo9wtx1zesujpofkck",
        "Name": "mysecondstack",
        "Type": "1",
        "EndpointID": "1",
        "EntryPoint": "docker-compose.yml",
        "SwarmID": "i0649w9uo9wtx1zesujpofkck",
        "ProjectPath": "/data/compose/mysecondstack_i0649w9uo9wtx1zesujpofkck"
      },
      {
        "Id": "mythirdstack_w9uo9wtxi064ujpofkck91zes",
        "Name": "mythirdstack",
        "Type": "1",
        "EndpointID": "1",
        "EntryPoint": "docker-compose.yml",
        "SwarmID": "mythirdstack_w9uo9wtxi064ujpofkck91zes",
        "ProjectPath": "/data/compose/mythirdstack_mythirdstack_w9uo9wtxi064ujpofkck91zes"
      },
    ]
    
    The 'list' action with the 'quiet' mode enabled:
      psu -a list -u admin -p password -l http://portainer.local -q
    Output the name of the stacks already deployed:
      mystack
      mysecondstack
      mythirdstack
    tortuetorche committed May 13, 2019
    Copy the full SHA
    f08d09e View commit details
    Browse the repository at this point in the history