bulk-create-blueprint

Attention

Creating 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-create-blueprint command allows you to create one or more blueprints (bulk load) from a list defined in a json file. What catalog the blueprint(s) are added to 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-create-blueprint --help
usage: bulk-create-blueprint [-h] [--loadexamples] [--jsonfile JSONFILE]
                             [--groupids GROUPIDS] [--createdby CREATEDBY]
                             [--testload] [--interactive] [--skipdups]
                             [--catalogid CATALOGID] [--publicCatalog]
                             [--not-active-version]

Bulk create of a set of blueprints. Also provides easy load of blueprint
examples

optional arguments:
  -h, --help            show this help message and exit
  --loadexamples        Load example blueprints from this package
  --jsonfile JSONFILE   file containing all directives to locate, load and add
                        a set of blueprints.
  --groupids GROUPIDS   Delimited list of groupIds to associate blueprint with
  --createdby CREATEDBY
                        Optional created by tag for labeling blueprint
  --testload            process jsonfile without actually performing any adds
  --interactive         Prompt for each add
  --skipdups            Skip adding blueprints already in catalog
  --catalogid CATALOGID
                        Optional catalogId to add blueprint to, defaults to
                        company catalog
  --publicCatalog       Use public catalog
  --not-active-version  Does not set blueprints to the current active version.
                        Note the default for this command is to set the new
                        blueprints as ActiveVersion

Example

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

Example json file

The contents of the json file load_my_blueprints.json

[
    {"main_blueprint_file":"apache_web_server_network_selector_no_cm.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_apache_icon.png"},
    {"main_blueprint_file":"apache_web_server_no_cm.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_apache_icon.png"},
    {"main_blueprint_file":"apache_web_server_no_cm_automation.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_apache_icon.png"},
    {"main_blueprint_file":"apache_web_server_with_chef.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_apache_icon.png"},
    {"main_blueprint_file":"apache_web_server_with_chef_auto_scaling.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_apache_icon.png"},
    {"main_blueprint_file":"apache_web_server_with_chef_lb_and_auto_scaling.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_apache_icon.png"},
    {"main_blueprint_file":"apache_web_servers_no_cm_with_lb.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_apache_icon.png"},
    {"main_blueprint_file":"docker_apache_server.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_apache_icon.png"},
    {"main_blueprint_file":"docker_tomcat_wildbook_server.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_wildbook_icon.png"},
    {"main_blueprint_file":"drupal_with_chef_auto_scaling.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_drupal_icon.png"},
    {"main_blueprint_file":"joomla_two_server.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_joomla_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_wildbook_icon.png"},
    {"main_blueprint_file":"windows_apache_web_server_no_cm.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_apache_icon.png"},
    {"main_blueprint_file":"windows_apache_with_chef_auto_scaling.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_apache_icon.png"},
    {"main_blueprint_file":"windows_iis_stack_with_chef.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_iis_icon.png"},
    {"main_blueprint_file":"wordpress_with_chef_auto_scaling.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_wordpress_icon.png"},
    {"main_blueprint_file":"wordpress_with_puppet_lb_and_auto_scaling.yaml","import_files":["base_types.yaml"],"image_file":"dcm_sample_wordpress_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

bulk-create-blueprint --jsonfile load_my_blueprints.json
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
  Verified template: "Apache Web Server on Linux with Network Selector"
  Added "Apache Web Server on Linux with Network Selector", version: 1.00,  id: 26
Loading Prod_Blueprints/apache_web_server_no_cm.yaml
  Verified template: "Apache Web Server on Linux"
  Added "Apache Web Server on Linux", version: 1.00,  id: 27
Loading Prod_Blueprints/apache_web_server_no_cm_automation.yaml
  Verified template: "Apache Web Server on Linux with automation"
  Added "Apache Web Server on Linux with automation", version: 1.00,  id: 28
Loading Prod_Blueprints/apache_web_server_with_chef.yaml
  Verified template: "Apache Web Server on Linux using Chef"
  Added "Apache Web Server on Linux using Chef", version: 1.00,  id: 29
Loading Prod_Blueprints/apache_web_server_with_chef_auto_scaling.yaml
  Verified template: "Apache Web Server on Linux with automation using Chef"
  Added "Apache Web Server on Linux with automation using Chef", version: 1.00,  id: 30
Loading Prod_Blueprints/apache_web_server_with_chef_lb_and_auto_scaling.yaml
  Verified template: "Apache Web Server on Linux with AWS ELB and automation using Chef"
  Added "Apache Web Server on Linux with AWS ELB and automation using Chef", version: 1.00,  id: 31
Loading Prod_Blueprints/apache_web_servers_no_cm_with_lb.yaml
  Verified template: "Apache Web Server on Linux with AWS ELB and automation"
  Added "Apache Web Server on Linux with AWS ELB and automation", version: 1.00,  id: 32
Loading Prod_Blueprints/docker_apache_server.yaml
  Verified template: "Docker Apache Server on Linux"
  Added "Docker Apache Server on Linux", version: 1.00,  id: 33
Loading Prod_Blueprints/docker_tomcat_wildbook_server.yaml
  Verified template: "Docker Tomcat Wildbook 2 container stack on Linux"
  Added "Docker Tomcat Wildbook 2 container stack on Linux", version: 1.00,  id: 34
Loading Prod_Blueprints/drupal_with_chef_auto_scaling.yaml
  Verified template: "Drupal Two Server Stack using Chef"
  Added "Drupal Two Server Stack using Chef", version: 1.00,  id: 35
Loading Prod_Blueprints/joomla_two_server.yaml
  Verified template: "Joomla Two Server Stack using Chef"
  Added "Joomla Two Server Stack using Chef", version: 1.00,  id: 36
Loading Prod_Blueprints/nagios_server_with_chef.yaml
  Verified template: "Nagios Server on Linux using Chef"
  Added "Nagios Server on Linux using Chef", version: 1.00,  id: 37
Loading Prod_Blueprints/openldap_server_with_chef.yaml
  Verified template: "OpenLDAP Server on Linux using Chef"
  Added "OpenLDAP Server on Linux using Chef", version: 1.00,  id: 38
Loading Prod_Blueprints/tomcat_web_server_wildbook_app_with_lb_chef.yaml
  Verified template: "Tomcat Wildbook Three Server Stack using Chef"
  Added "Tomcat Wildbook Three Server Stack using Chef", version: 1.00,  id: 39
Loading Prod_Blueprints/windows_apache_web_server_no_cm.yaml
  Verified template: "Apache Web Server on Windows"
  Added "Apache Web Server on Windows", version: 1.00,  id: 40
Loading Prod_Blueprints/windows_apache_with_chef_auto_scaling.yaml
  Verified template: "Apache Web Server on Windows using Chef"
  Added "Apache Web Server on Windows using Chef", version: 1.00,  id: 41
Loading Prod_Blueprints/windows_iis_stack_with_chef.yaml
  Verified template: "Microsoft IIS Two Server Stack using Chef"
  Added "Microsoft IIS Two Server Stack using Chef", version: 1.00,  id: 42
Loading Prod_Blueprints/wordpress_with_chef_auto_scaling.yaml
  Verified template: "WordPress Two Server Stack using Chef"
  Added "WordPress Two Server Stack using Chef", version: 1.00,  id: 43
Loading Prod_Blueprints/wordpress_with_puppet_lb_and_auto_scaling.yaml
  Verified template: "WordPress Two Server Stack using Puppet"
  Added "WordPress Two Server Stack using Puppet", version: 1.00,  id: 44

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

As soon as the bulk-create-blueprint command completes successfully, the blueprint(s) will appear on the Dell Cloud Manager console.

../_images/bulk_blueprints_on_console.png