Pivotal Knowledge Base

Follow

How to download Pivotal Greenplum products using the Pivotal Network API

Environment

Product Version
Pivotal Greenplum (GPDB) All versions
OS RHEL 6.x (with Internet connection)
Others Python 2.6

Purpose

This article illustrates how users can download and upload Pivotal Greenplum products via API.

Using the Pivotal Network file, download the API and the Ops Manager API.  You can minimize the data transfers and automate the process rather than relying on the web browser UIs. 

Procedure

  • Go to your Pivotal Network, click Edit Profile, and copy your API token.

  • Export the API token to a shell variable:
 export PIVNET_TOKEN="aaaaaAaAAAaaaaAAAAAaaa"
  • To get the file ID of a download, browse to the download you require, click the “i” icon for more information, and copy the URL.

  • Now attempt the download using wget and the information displayed on the screen.

 

  1. Name the file. In this case, "greenplum-db-4.3.7.3-build-2-RHEL5-x86_64.zip” is used. 
  2. Use the "$PIVNET_TOKEN" in the header field.
  3. Substitute the "API download URL" at the end.

If this procedure proceeds smoothly, there will be a HTTP 302 response, wget will follow the redirect, and the download will start.

If there are issues, please review the documentation available on the API documentation page for the response code.

[gpadmin@gpdbsne Desktop]$ wget -O "greenplum-db-4.3.7.3-build-2-RHEL5-x86_64.zip"  --post-data="" --header="Authorization: Token $PIVNET_TOKEN"  https://network.pivotal.io/api/v2/products/pivotal-gpdb/releases/1533/product_files/4000/download
--2016-03-09 14:26:43--  https://network.pivotal.io/api/v2/products/pivotal-gpdb/releases/1533/product_files/4000/download
Resolving network.pivotal.io (network.pivotal.io)... 52.2.219.186, 107.23.239.173, 52.2.219.186
Connecting to network.pivotal.io (network.pivotal.io)|52.2.219.186|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://dtb5pzswcit1e.cloudfront.net/product_files/Pivotal-Greenplum/greenplum-db-4.3.7.3-build-2-RHEL5-x86_64.zip?Expires=1457533623&Signature=IGTP1XZwL-Z6F2cTg2mImwDMp8nKagmVW%7EmtlP1ppopbrXV856lvXKCnit4LF61rpx9IX1TbmBpq1VinH3bMM2%7EfUU01NiGnU-DeP6CNkCoMEMm6TGTane9n5GoVeUrAVcBfu71WJOpDkAUkun4rD3DglbBQ3pV3QiU98aD-vg0_&Key-Pair-Id=APKAJLAM6FL65BYZP7UQ&filename=greenplum-db-4.3.7.3-build-2-RHEL5-x86_64.zip [following]
--2016-03-09 14:26:44--  https://dtb5pzswcit1e.cloudfront.net/product_files/Pivotal-Greenplum/greenplum-db-4.3.7.3-build-2-RHEL5-x86_64.zip?Expires=1457533623&Signature=IGTP1XZwL-Z6F2cTg2mImwDMp8nKagmVW%7EmtlP1ppopbrXV856lvXKCnit4LF61rpx9IX1TbmBpq1VinH3bMM2%7EfUU01NiGnU-DeP6CNkCoMEMm6TGTane9n5GoVeUrAVcBfu71WJOpDkAUkun4rD3DglbBQ3pV3QiU98aD-vg0_&Key-Pair-Id=APKAJLAM6FL65BYZP7UQ&filename=greenplum-db-4.3.7.3-build-2-RHEL5-x86_64.zip
Resolving dtb5pzswcit1e.cloudfront.net (dtb5pzswcit1e.cloudfront.net)... 52.85.232.237, 52.85.232.123, 52.85.232.90, ...
Connecting to dtb5pzswcit1e.cloudfront.net (dtb5pzswcit1e.cloudfront.net)|52.85.232.237|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 141201754 (135M) [application/zip]
Saving to: ‘greenplum-db-4.3.7.3-build-2-RHEL5-x86_64.zip’

100%[================================================================================================================================================================================================================================================>] 141,201,754 5.71MB/s   in 32s    

2016-03-09 14:27:17 (4.19 MB/s) - ‘greenplum-db-4.3.7.3-build-2-RHEL5-x86_64.zip’ saved [141201754/141201754]

Interactive script

If you would like to use this API as interactive script, attached at the bottom of this article is a interactive script (downloadgpdb.sh).

  • Copy to the server of your choice (you should have access to the Internet).
  • Run the script using the command shown below.
/bin/bash /tmp/download.sh 

An example is shown below:

[gpadmin@gpdbsne Desktop]$ /bin/bash /tmp/downloadgpdb.sh 
INFO - Starting the program
INFO - Generating the directories name / location where the output logs will saved / stored
INFO - Creating the directory needed for the program
INFO - Setting the download directory to: 
Enter the download directory : /tmp/d
INFO - Setting the connection token

To get your API Token

 	 + Connect to network.pivotal.io with your username / password
	 + Click on Edit profile
	 + Scroll to the bottom on the page where you will see your API Token. 

Enter your network.pivotal.io API Token: aaaaaAaAAAaaaaAAAAAaaa
INFO - Authenticating the API Token
INFO - Getting the product list
INFO - Setting the product list to:  Pivotal Greenplum
INFO - Product name "Pivotal Greenplum" found, continue ...
INFO - Getting the Slug ID
INFO - Getting the Product ID
INFO - Getting the Releases
INFO - Getting the product version

These are the available versions:

4.3.7.3
4.3.7.2
4.3.7.1
4.3.7.0
4.3.6.2
4.3.6.1
4.3.5.4
4.3.5.3
4.3.5.2
4.3.5.1
4.3.5.0
4.3.4.2
4.3.4.0
4.3.3.1
4.3.3.0
4.3.2.1
4.3.2.0
4.3.1.0
4.2.8.5
4.2.8.4
4.2.8.3
4.2.8.2
4.2.8.1
4.2.8.0

Which version of greenplum database do you want to download (for eg.s 4.3.4.0) ? 4.3.6.1
INFO - Getting the Release ID
INFO - Getting the File ID
INFO - Obtaining the files available for the release

These are the available files:

Greenplum Database 4.3.6.1 Sandbox Virtual Machine for VMware
Greenplum Database 4.3.6.1 Sandbox Virtual Machine for Virtual Box
Greenplum Data Computing Appliance Database Installer 4.3.6.1
Greenplum Database 4.3.6.1 for SuSE Linux Enterprise Server SLES 10 and SLES 11
Greenplum Database 4.3.6.1 for Red Hat Enterprise Linux 5 and 6
Greenplum Database 4.3.6.1 for Mac OS X (Trial Only)
Greenplum Database 4.3.6.1 Release Notes
Clients for Windows
Clients for SuSE Linux Enterprise Server x86_64 (SLES 10 and SLES 11)
Clients for Solaris - 10 x86_64
Clients for Solaris - 10 i386
Clients for Solaris 10 - SPARC64
Clients for Solaris 10 - SPARC32
Clients for Red Hat Enterprise Linux x86_64 (RHEL5 and RHEL6)
Clients for Red Hat Enterprise Linux i386 (RHEL5)
Clients for Apple OSX on Intel processors (32-bit)
Clients for HP-UX 11i v3 (B.11.31) Intel Itanium
Clients for AIX 5.3L and AIX 6.1 (64-bit)
Clients for AIX 5.3L (32-bit)
Connectivity for Windows
Connectivity for SuSE Linux Enterprise Server x86_64 (SLES 10 and SLES 11)
Connectivity for Solaris 10 - x86_64
Connectivity for Solaris 10 - i386
Connectivity for Solaris 10 - SPARC64
Connectivity for Solaris 10 - SPARC32
Connectivity for Red Hat Enterprise Linux x86_64 (RHEL5 and RHEL6)
Connectivity for Red Hat Enterprise Linux i386 (RHEL5)
Connectivity for Apple OSX on Intel processors (32-bit)
Connectivity for AIX 5.3L and AIX 6.1 (64-bit)
Connectivity for AIX 5.3L (32-bit)
Loaders for Windows
Loaders for SuSE Linux Enterprise Server x86_64
Loaders for Solaris 10 - x86_64
Loaders for Solaris 10 - i386
Loaders for Solaris 10 - SPARC64
Loaders for Solaris 10 - SPARC32
Loaders for Red Hat Enterprise Linux x86_64 (RHEL5 and RHEL6)
Loaders for Red Hat Enterprise Linux i386 (RHEL5)
Loaders for Apple OSX on Intel processors (32-bit)
Loaders for HP-UX 11i v3 (B.11.31) Intel Itanium
Loaders for AIX 5.3L and AIX 6.1 (64-bit)
Loaders for AIX 5.3L (32-bit)
Greenplum Database 4.3 - PL/Perl Extension for RHEL 7
Greenplum Database 4.3 - PL/Java Extension for SuSE
Greenplum Database 4.3 - PL/Java Extension for RHEL
Greenplum Database 4.3 - PL/Perl Extension for SuSE 11
Greenplum Database 4.3 - PL/Perl Extension for SuSE 10
Greenplum Database 4.3 - PL/Perl Extension for RHEL 6 (or DCA v2+)
Greenplum Database 4.3 - PL/Perl Extension for RHEL 5 (or DCA v1)
Greenplum Database 4.3 - PL/Java Extension for RHEL
Greenplum Database 4.3 - PL/Java Extension for SuSE
Greenplum Database 4.3 - PL/R Extension for RHEL
Greenplum Database 4.3 - PL/R Extension for SuSE
Greenplum Database 4.3 - Pgcrypto Extension for RHEL
Greenplum Database 4.3 - Pgcrypto Extension for SuSE
Greenplum Database 4.3 - PostGIS Extension for RHEL
Greenplum Database 4.3 - PostGIS Extension for SuSE
Greenplum Database 4.3 - MADLib 1.7.1
Greenplum Database 4.3 - MADLib 1.8
Greenplum Database 4.3 - Partner Connector 1.2, RHEL
DataDirect ODBC Drivers 7.1.4 README
Greenplum Database 4.x - ODBC Driver for Solaris (SPARC) 32 bit
Greenplum Database 4.x - ODBC Driver for Linux 32 bit
Greenplum Database 4.x - ODBC Driver for HPUX 32 bit
Greenplum Database 4.x - ODBC Driver for AIX 32 bit
Greenplum Database 4.x - ODBC Driver for Windows 32 bit
Greenplum Database 4.x - ODBC Driver for HPUX IA 32 bit
Greenplum Database 4.x - ODBC Driver for Windows 64 bit
Greenplum Database 4.x - ODBC Driver for Solaris (x64) 64 bit
Greenplum Database 4.x - ODBC Driver for Linux Itanium 64 bit
Greenplum Database 4.x - ODBC Driver for Solaris (SPARC) 64 bit
Greenplum Database 4.x - ODBC Driver for Linux 64 bit
Greenplum Database 4.x - ODBC Driver for HPUX IA 64 bit
Greenplum Database 4.x - ODBC Driver for AIX 64 bit
Greenplum Database 4.x - JDBC Driver 32 & 64 bit
DataDirect JDBC Drivers 5.1.1 README
Greenplum Database - Command Center 2.0 Release Notes
Greenplum Database - Command Center 2.0
Greenplum Database - Command Center 1.3.0.3 Release Notes
Greenplum Database - Command Center 1.3.0.3
Greenplum Database - Command Center 1.2.2.1
Greenplum Database - Command Center 1.2.2.1 Release Notes
Greenplum Database - Command Center 1.2.2.2
Greenplum Database - Command Center 1.2.2.2 Release Notes
Greenplum Database - Command Center 1.2.2.3 Release Notes
Greenplum Database - Command Center 1.2.2.3
Greenplum Database - Command Center 1.2.2.4 Release Notes
Greenplum Database - Command Center 1.2.2.4
Greenplum Database - Command Center 1.3.0.0 Release Notes
Greenplum Database - Command Center 1.3.0.0
Greenplum Database - Command Center 1.3.0.1
Greenplum Database - Command Center 1.3.0.1 Release Notes
Greenplum Database - Command Center 1.3.0.2
Greenplum Database - Command Center 1.3.0.2 Release Notes
Greenplum Database Support Utility
Greenplum Database Support Utility
Greenplum Database Support Utility

Which  files do you want to download (copy the entire line from above)? Greenplum Database Support Utility

INFO - Found multiple version for file: Greenplum Database Support Utility

These are the available version for the file:

1.2.0.0
1.1.0.0
1.0.0.0

Which version of the file " Greenplum Database Support Utility " do you want to download? 1.2.0.0
INFO - Accepting the agreement
INFO - Downloading the file
--2016-03-09 14:20:44--  https://network.pivotal.io/api/v2/products/pivotal-gpdb/releases/567/product_files/1411/download
Resolving network.pivotal.io (network.pivotal.io)... 52.2.219.186, 107.23.239.173, 52.2.219.186
Connecting to network.pivotal.io (network.pivotal.io)|52.2.219.186|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://dtb5pzswcit1e.cloudfront.net/product_files/Pivotal-Greenplum/gpsupport.gz?Expires=1457533265&Signature=QJAh74D790FdmMhyT-cezGxNcfCYQ0cfznHqQMiV3IInqAbPwJ9Rg22DHAbcWG8MjkYuToxxPXaWeLgL8kOruoK-Cn-z0vcUT-K3PZdz6wPs7qA4AtDNsnRNf660hI%7EqPvi64XBDYNL5L2yFbosf22bY-ijpFsjBm2fbpSn0Vig_&Key-Pair-Id=APKAJLAM6FL65BYZP7UQ&filename=gpsupport.gz [following]
--2016-03-09 14:20:45--  https://dtb5pzswcit1e.cloudfront.net/product_files/Pivotal-Greenplum/gpsupport.gz?Expires=1457533265&Signature=QJAh74D790FdmMhyT-cezGxNcfCYQ0cfznHqQMiV3IInqAbPwJ9Rg22DHAbcWG8MjkYuToxxPXaWeLgL8kOruoK-Cn-z0vcUT-K3PZdz6wPs7qA4AtDNsnRNf660hI%7EqPvi64XBDYNL5L2yFbosf22bY-ijpFsjBm2fbpSn0Vig_&Key-Pair-Id=APKAJLAM6FL65BYZP7UQ&filename=gpsupport.gz
Resolving dtb5pzswcit1e.cloudfront.net (dtb5pzswcit1e.cloudfront.net)... 52.85.232.243, 52.85.232.50, 52.85.232.24, ...
Connecting to dtb5pzswcit1e.cloudfront.net (dtb5pzswcit1e.cloudfront.net)|52.85.232.243|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3090611 (2.9M) [binary/octet-stream]
Saving to: ‘/tmp/d/gpsupport.gz’

100%[================================================================================================================================================================================================================================================>] 3,090,611   1.42MB/s   in 2.1s   

2016-03-09 14:20:49 (1.42 MB/s) - ‘/tmp/d/gpsupport.gz’ saved [3090611/3090611]

INFO - Download successful, file: "Greenplum Database Support Utility" , Location: "/tmp/d"

[gpadmin@gpdbsne Desktop]$ 

Comments

  • Avatar
    Brendan Stephens

    This is great --
    Note that OSX does not support `tac` by default, but the same behavior can be accomplished with `tail -r`

Powered by Zendesk