bulk-update-blueprint

Attention

Updating blueprints in a public or private catalog requires the authority to manage the catalog. Refer to the Catalogs section in this document for more information.

The bulk-update-blueprint command allows you to update one or more blueprints (bulk update) from a list defined in a json file. What catalog the blueprint(s) are updated in is determined by one of the options in the order below:

  1. By specifying the --publicCatalog command argument.
  2. By specifying the desired company catalog with the command argument --catalogid
  3. Otherwise the company catalog associated with the customer of the user running the command is used. The company catalog will be created if it does not exist.

Help

bulk-update-blueprint --help
usage: bulk-update-blueprint [-h] [--groupids GROUPIDS] [--testupdate]
                             [--forceupdate] [--interactive] [--addnew]
                             [--catalogid CATALOGID] [--publicCatalog]
                             jsonfile

Bulk update of a set of blueprints. Provides automatic version checking to
only update newer versions.

positional arguments:
  jsonfile              file containing all directives to locate, load and
                        update a set of blueprints.

optional arguments:
  -h, --help            show this help message and exit
  --groupids GROUPIDS   Delimited list of groupIds to associate blueprint with
  --testupdate          process jsonfile without actually performing any
                        updates/adds
  --forceupdate         Bypass version checking and update anyway
  --interactive         Prompt for each add
  --addnew              Add blueprints not already in catalog, default is to
                        skip any adds
  --catalogid CATALOGID
                        Optional catalogId to use for bulk operation, defaults
                        to company catalog
  --publicCatalog       Use public catalog

Example

Here is an example of updating multple blueprints in the customer company catalog.

Example json file

The contents of the json file update_my_blueprints.json has the same format as the json file used to bulk create blueprints used by the bulk-create-blueprint command.

[
    {"main_blueprint_file":"apache_web_server_network_selector_no_cm.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_icon.png"},
    {"main_blueprint_file":"apache_web_server_no_cm.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_icon.png"},
    {"main_blueprint_file":"apache_web_server_no_cm_automation.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_icon.png"},
    {"main_blueprint_file":"apache_web_server_with_chef.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_icon.png"},
    {"main_blueprint_file":"apache_web_server_with_chef_auto_scaling.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_icon.png"},
    {"main_blueprint_file":"apache_web_server_with_chef_lb_and_auto_scaling.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_icon.png"},
    {"main_blueprint_file":"apache_web_servers_no_cm_with_lb.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_icon.png"},
    {"main_blueprint_file":"docker_apache_server.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_icon.png"},
    {"main_blueprint_file":"docker_tomcat_wildbook_server.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_icon.png"},
    {"main_blueprint_file":"drupal_with_chef_auto_scaling.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_icon.png"},
    {"main_blueprint_file":"joomla_two_server.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_icon.png"},
    {"main_blueprint_file":"nagios_server_with_chef.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_nagios_icon.png"},
    {"main_blueprint_file":"openldap_server_with_chef.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_openldap_icon.png"},
    {"main_blueprint_file":"tomcat_web_server_wildbook_app_with_lb_chef.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_icon.png"},
    {"main_blueprint_file":"windows_apache_web_server_no_cm.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_icon.png"},
    {"main_blueprint_file":"windows_apache_with_chef_auto_scaling.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_icon.png"},
    {"main_blueprint_file":"windows_iis_stack_with_chef.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_icon.png"},
    {"main_blueprint_file":"wordpress_with_chef_auto_scaling.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_icon.png"},
    {"main_blueprint_file":"wordpress_with_puppet_lb_and_auto_scaling.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_icon.png"}
]

Note

The entries in the json file contain 3 parts:

  • main_blueprint_file - file name of the main blueprint template file
  • import_files - one or more comma separated files needed to build the blueprint, minimally the base_types.yaml file
  • image_file - file name of the image to associate with the blueprint (optional)

The files specified in the json file may need to include the directory path (if needed) for the bulk-create-blueprint command to locate them.

Example command

Note

In the example below the --forceupdate option is used which will force the updates even if the blueprint versions are the same.

bulk-update-blueprint update_my_blueprints.json --forceupdate
Loading API environment
  API access validated
  API access key type is User, userId: 10
  Found Company catalog, id= 10
Defaulting to Company catalog, id: 10
Found 19 items in bulk input
Loading Prod_Blueprints/apache_web_server_network_selector_no_cm.yaml
Template "Apache Web Server on Linux with Network Selector" queued for UPDATE, version check bypassed
Updated id: 26 name='Apache Web Server on Linux with Network Selector'
Loading Prod_Blueprints/apache_web_server_no_cm.yaml
Template "Apache Web Server on Linux" queued for UPDATE, version check bypassed
Updated id: 27 name='Apache Web Server on Linux'
Loading Prod_Blueprints/apache_web_server_no_cm_automation.yaml
Template "Apache Web Server on Linux with automation" queued for UPDATE, version check bypassed
Updated id: 28 name='Apache Web Server on Linux with automation'
Loading Prod_Blueprints/apache_web_server_with_chef.yaml
Template "Apache Web Server on Linux using Chef" queued for UPDATE, version check bypassed
Updated id: 29 name='Apache Web Server on Linux using Chef'
Loading Prod_Blueprints/apache_web_server_with_chef_auto_scaling.yaml
Template "Apache Web Server on Linux with automation using Chef" queued for UPDATE, version check bypassed
Updated id: 30 name='Apache Web Server on Linux with automation using Chef'
Loading Prod_Blueprints/apache_web_server_with_chef_lb_and_auto_scaling.yaml
Template "Apache Web Server on Linux with AWS ELB and automation using Chef" queued for UPDATE, version check bypassed
Updated id: 31 name='Apache Web Server on Linux with AWS ELB and automation using Chef'
Loading Prod_Blueprints/apache_web_servers_no_cm_with_lb.yaml
Template "Apache Web Server on Linux with AWS ELB and automation" queued for UPDATE, version check bypassed
Updated id: 32 name='Apache Web Server on Linux with AWS ELB and automation'
Loading Prod_Blueprints/docker_apache_server.yaml
Template "Docker Apache Server on Linux" queued for UPDATE, version check bypassed
Updated id: 33 name='Docker Apache Server on Linux'
Loading Prod_Blueprints/docker_tomcat_wildbook_server.yaml
Template "Docker Tomcat Wildbook 2 container stack on Linux" queued for UPDATE, version check bypassed
Updated id: 34 name='Docker Tomcat Wildbook 2 container stack on Linux'
Loading Prod_Blueprints/drupal_with_chef_auto_scaling.yaml
Template "Drupal Two Server Stack using Chef" queued for UPDATE, version check bypassed
Updated id: 35 name='Drupal Two Server Stack using Chef'
Loading Prod_Blueprints/joomla_two_server.yaml
Template "Joomla Two Server Stack using Chef" queued for UPDATE, version check bypassed
Updated id: 36 name='Joomla Two Server Stack using Chef'
Loading Prod_Blueprints/nagios_server_with_chef.yaml
Template "Nagios Server on Linux using Chef" queued for UPDATE, version check bypassed
Updated id: 37 name='Nagios Server on Linux using Chef'
Loading Prod_Blueprints/openldap_server_with_chef.yaml
Template "OpenLDAP Server on Linux using Chef" queued for UPDATE, version check bypassed
Updated id: 38 name='OpenLDAP Server on Linux using Chef'
Loading Prod_Blueprints/tomcat_web_server_wildbook_app_with_lb_chef.yaml
Template "Tomcat Wildbook Three Server Stack using Chef" queued for UPDATE, version check bypassed
Updated id: 39 name='Tomcat Wildbook Three Server Stack using Chef'
Loading Prod_Blueprints/windows_apache_web_server_no_cm.yaml
Template "Apache Web Server on Windows" queued for UPDATE, version check bypassed
Updated id: 40 name='Apache Web Server on Windows'
Loading Prod_Blueprints/windows_apache_with_chef_auto_scaling.yaml
Template "Apache Web Server on Windows using Chef" queued for UPDATE, version check bypassed
Updated id: 41 name='Apache Web Server on Windows using Chef'
Loading Prod_Blueprints/windows_iis_stack_with_chef.yaml
Template "Microsoft IIS Two Server Stack using Chef" queued for UPDATE, version check bypassed
Updated id: 42 name='Microsoft IIS Two Server Stack using Chef'
Loading Prod_Blueprints/wordpress_with_chef_auto_scaling.yaml
Template "WordPress Two Server Stack using Chef" queued for UPDATE, version check bypassed
Updated id: 43 name='WordPress Two Server Stack using Chef'
Loading Prod_Blueprints/wordpress_with_puppet_lb_and_auto_scaling.yaml
Template "WordPress Two Server Stack using Puppet" queued for UPDATE, version check bypassed
Updated id: 44 name='WordPress Two Server Stack using Puppet'

Total blueprints processed: 19
Total blueprints verified 0
Total blueprints skipped: 0
Total blueprints in error: 0
Total blueprints updated: 19

Total blueprints added: 0