Pivotal/Cloud Foundry/OpsManager

From r00tedvw.com wiki
(Difference between revisions)
Jump to: navigation, search
(Download Product tile)
Line 38: Line 38:
 
*product file ID
 
*product file ID
 
Let's start by getting the product-slug for the mysqlv2 tile
 
Let's start by getting the product-slug for the mysqlv2 tile
  <nowiki>[~] pivnet products | grep mysql
+
  <nowiki>[~] pivnet products | grep -E 'SLUG|mysql'
 +
| ID  |                    SLUG                    |              NAME              |
 
|  41 | p-mysql                                    | MySQL for PCF v1              |
 
|  41 | p-mysql                                    | MySQL for PCF v1              |
 
| 209 | a9s-mysql                                  | a9s MySQL for PCF              |
 
| 209 | a9s-mysql                                  | a9s MySQL for PCF              |

Revision as of 16:15, 27 August 2018

Cloud Foundry | Cloud Foundry CLI | Apps | Tasks | Logs | OpsManager

Contents

install packages via cli with om tools

install om-tools

Start by installing om-tools, a cli tool for interacting with pivnet. Download the latest release from github (https://github.com/pivotal-cf/om/)

~$ wget https://github.com/pivotal-cf/om/releases/download/0.39.0/om-linux
~$ chmod +x ~/om-linux
~$ ln -s ~/om-linux /usr/local/bin/om
~$ source ~/.bash_profile
~$ om -version

install pivnet cli

Next we need to install the pivnet cli. Download the latest release from github (https://github.com/pivotal-cf/pivnet-cli/)

~$ wget https://github.com/pivotal-cf/pivnet-cli/releases/download/v0.0.53/pivnet-darwin-amd64-0.0.53
~$ chmod +x ~/pivnet-darwin-amd64-0.0.53
~$ ln -s ~/Git/pivnet-cli/pivnet-darwin-amd64-0.0.53 /usr/local/bin/pivnet
~$ source ~/.bash_profile
~$ pivnet -version

get pivnet token

Get your pivnet legacy token from here: https://login.run.pivotal.io/login
Click Username > Edit Profile > Look for LEGACY API TOKEN [DEPRECATED] > copy token.
Apply the API token and test the pivnet CLI

~$ pivnet login --api-token=h9482hd929dh2998hg
~$ pivnet products

Setup alias or token variable

Depending on how you want to communicate through om, you can either use a username/password combo or a token from ops manager.

Username/Password

alias oml="om -k -t https://opsmgr-10.haas-59.pez.pivotal.io -u admin -p password"

Download Product tile

While you can very easily do this by simply going to https://network.pivotal.io/, i'm going to show how to do it through solely CLI.
Using pivnet cli we need to discover the following items before we can download the product file:

  • product-slug (generally the product name)
  • release version (can include spaces)
  • product file ID

Let's start by getting the product-slug for the mysqlv2 tile

[~] pivnet products | grep -E 'SLUG|mysql'
| ID  |                    SLUG                    |              NAME              |
|  41 | p-mysql                                    | MySQL for PCF v1               |
| 209 | a9s-mysql                                  | a9s MySQL for PCF              |
| 180 | pivotal-mysql                              | MySQL for PCF                  |

Now lets get the most current release vesion

[~] pivnet releases -p pivotal-mysql
+--------+---------+--------------------------------+--------------------------+
|   ID   | VERSION |          DESCRIPTION           |        UPDATED AT        |
+--------+---------+--------------------------------+--------------------------+
| 122966 | 2.3.1   | MySQL for PCF v2.3.1. It       | 2018-07-12T20:27:34.759Z |
|        |         | provides dedicated single node |                          |
|        |         | instances with configurable    |                          |
|        |         | plans, full backups, and       |                          |
|        |         | metrics.                       |                          |

Finally lets get the product file ID:

[~] pivnet product-files -p pivotal-mysql -r 2.3.1
+--------+--------------------------------+--------------+---------------------+------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+
|   ID   |              NAME              | FILE VERSION |      FILE TYPE      |                              SHA256                              |                                            AWS OBJECT KEY                                            |
+--------+--------------------------------+--------------+---------------------+------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+
| 149560 | Open Source License Disclosure |            1 | Open Source License | 2a3c887a92d299e19db179ed12d93aa5dc715c4c0665100a493428f9da4ac228 | product-files/pivotal-mysql/open_source_license_pivotal-mysql-2.3.0-build.172-f1cb31e-1526618752.txt |
|        | for MySQL for PCF 2.3.0        |              |                     |                                                                  |                                                                                                      |
| 164030 | MySQL for PCF v2               | 2.3.1        | Software            | 370d15b112965c3fddb01ff9f921534d6b906d86e1ca3dcc22c451096292fda3 | product-files/pivotal-mysql/pivotal-mysql-2.3.1-build.11.pivotal                                     |
+--------+--------------------------------+--------------+---------------------+------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+

With all (3) we can now download the tile:

[~] pivnet download-product-files -p pivotal-mysql -r 2.3.1 -i 164030 -d /Users/John/Downloads --accept-eula

quick reference

query opsmanager api and print pretty json

~$ testjson=$(curl "https://opsmgr-15.haas-59.pez.pivotal.io/api/v0/stemcell_assignments" --insecure \
    -X GET \
    -H "Authorization: Bearer $access_token") | echo $testjson | python -m json.tool | more
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0{
    "products": [
        {
            "available_stemcell_versions": [
                "3468.51"
            ],
            "deployed_stemcell_version": "3468.51",
            "guid": "p-rabbitmq-49407616425a3f96dd5b",
            "identifier": "p-rabbitmq",
            "is_staged_for_deletion": false,
            "label": "RabbitMQ",
            "product_version": "1.12.7",
            "required_stemcell_os": "ubuntu-trusty",
            "required_stemcell_version": "3468.51",
            "staged_stemcell_version": "3468.51"
        },
        {
            "available_stemcell_versions": [
                "3541.37"
            ],
            "deployed_stemcell_version": "3541.37",
            "guid": "pivotal-mysql-f1cb955f294464dfaffd",
            "identifier": "pivotal-mysql",
            "is_staged_for_deletion": false,
            "label": "MySQL for Pivotal Cloud Foundry v2",
            "product_version": "2.3.1-build.11",
            "required_stemcell_os": "ubuntu-trusty",
            "required_stemcell_version": "3541.34",
            "staged_stemcell_version": "3541.37"
        },
        {
            "available_stemcell_versions": [
                "3541.37"
            ],
            "deployed_stemcell_version": "3541.37",
            "guid": "p-bosh-404ef12b578f0da0977e",
            "identifier": "p-bosh",
            "is_staged_for_deletion": false,
            "label": "BOSH Director",
            "product_version": "2.1-build.348",
            "required_stemcell_os": "ubuntu-trusty",
            "required_stemcell_version": "3541.37",
            "staged_stemcell_version": "3541.37"
        },
        {
            "available_stemcell_versions": [
                "3541.37"
            ],
            "deployed_stemcell_version": "3541.37",
            "guid": "cf-5a3f75999090a1afbfdb",
            "identifier": "cf",
            "is_staged_for_deletion": false,
            "label": "Pivotal Application Service",
            "product_version": "2.1.10",
            "required_stemcell_os": "ubuntu-trusty",
            "required_stemcell_version": "3541.36",
            "staged_stemcell_version": "3541.37"
        },
        {
            "available_stemcell_versions": [
                "3468.51"
            ],
            "deployed_stemcell_version": "3468.51",
            "guid": "p-spring-cloud-services-a033fcb589ee1a7435fa",
            "identifier": "p-spring-cloud-services",
            "is_staged_for_deletion": false,
            "label": "Spring Cloud Services",
            "product_version": "1.5.6",
            "required_stemcell_os": "ubuntu-trusty",
            "required_stemcell_version": "3468",
            "staged_stemcell_version": "3468.51"
        }
    ],
    "stemcell_library": [
        {
            "hypervisor": "esxi",
            "infrastructure": "vsphere",
            "light": false,
            "os": "ubuntu-trusty",
            "version": "3468.51"
        },
        {
            "hypervisor": "esxi",
            "infrastructure": "vsphere",
            "light": false,
            "os": "ubuntu-trusty",
            "version": "3541.37"
        }
    ]
}
100  2020    0  2020    0     0   1020      0 --:--:--  0:00:01 --:--:--  1020

Personal tools
Namespaces

Variants
Actions
Navigation
Mediawiki
Confluence
DevOps Tools
Open Source Products
Ubuntu
Ubuntu 22
Mac OSX
Oracle Linux
AWS
Windows
OpenVPN
Grafana
InfluxDB2
TrueNas
MagicMirror
OwnCloud
Pivotal
osTicket
OTRS
phpBB
WordPress
VmWare ESXI 5.1
Crypto currencies
HTML
CSS
Python
Java Script
PHP
Raspberry Pi
Canvas LMS
Kaltura Media Server
Plex Media Server
MetaSploit
Zoneminder
ShinobiCE
Photoshop CS2
Fortinet
Uploaded
Certifications
General Info
Games
Meal Plans
NC Statutes
Politics
Volkswagen
Covid
NCDMV
Toolbox