b5cff127b1221ea7354dafaf49b34d502c4f904d
[snaps.git] / docs / how-to-use / LibraryUsage.rst
1 **********************
2 SNAPS-OO Library Usage
3 **********************
4
5 The pattern used within the SNAPS-OO library for creating OpenStack
6 instances have been made as consistent as possible amongst the different
7 instance types. Each consists of a constructor that takes in a
8 credentials object and generally takes in a single "settings"
9 (configuration) object. The only exception to this rule is with the
10 OpenStackVMInstance (creates an OpenStack Server) where it takes in the
11 additional settings used for the associated image and SSH key-pairs
12 credentials as those objects contain additional attributes required of
13 SNAPS, primarily when one needs to obtain remote access. After
14 instantiation, the create() method must be called to initiate all of the
15 necessary remote API calls to OpenStack required for proper instance
16 creation.
17
18 SNAPS Credentials
19 =================
20
21 As communicating with OpenStack is performed via secure remote RESTful
22 API calls, any function or method performing any type of query or CRUD
23 operation must know how to connect to the NFVI. The class ***OSCreds***
24 defined in *snaps.openstack.os\_credentials.py* contains everything
25 required to connect to any Keystone v2.0 or v3 authorization server. The
26 attributes are listed below:
27
28 -  username
29 -  password
30 -  auth\_url
31 -  project\_name (aka. tenant\_name)
32 -  identity\_api\_version (for obtaining Keystone authorization token.
33    default = 2, Versions 2.0 & v3 only validated.)
34 -  image\_api\_version (default = 2, Glance version 1 & 2 only validated)
35 -  network\_api\_version (Neutron version 2 currently only validated)
36 -  compute\_api\_version (Nova version 2 currently only validated)
37 -  heat\_api\_version (Heat version 1 currently only validated)
38 -  volume\_api\_version (default = 2, Heat versions 2 & 3 currently only validated)
39 -  user\_domain\_id (default='default')
40 -  user\_domain\_name (default='Default')
41 -  project\_domain\_id (default='default')
42 -  project\_domain\_name (default='Default')
43 -  interface (default='admin', used to specify the endpoint type for keystone: public, admin, internal)
44 -  cacert (default=False, expected values T|F to denote server certificate verification, else value contains the path to an HTTPS certificate)
45 -  region_name (The region name default=None)
46 -  proxy\_settings
47
48    -  host (the HTTP proxy host)
49    -  port (the HTTP proxy port)
50    -  https\_host (the HTTPS proxy host, default value of host)
51    -  https\_port (the HTTPS proxy port, default value of port)
52    -  ssh\_proxy\_cmd (same as the value placed into ssh -o
53       ProxyCommand='<this config value>')
54
55 Create OS Credentials Object
56 ----------------------------
57
58 .. code:: python
59
60     from snaps.openstack.os_credentials import OSCreds
61     os_creds=OSCreds(username='admin', password='admin',
62                      auth_url='http://localhost:5000/v3', project_name='admin',
63                      identity_api_version=3)
64
65 SNAPS Object Creators
66 =====================
67
68 Each creator minimally requires an OSCreds object for connecting to the
69 NFVI, associated \*Settings object for instance configuration, create()
70 method to make the necessary remote API calls and create all of the
71 necessary OpenStack instances required, and clean() method that is
72 responsible for deleting all associated OpenStack instances. Please see
73 the class diagram `here </display/SNAP/SNAPS-OO+Classes>`__. Below is a
74 textual representation of the requirements of each creator classes with
75 their associated setting classes and a sample code snippet on how to use
76 the code.
77
78 Create User
79 -----------
80 -  User - snaps.openstack.create\_user.OpenStackUser
81
82    -  snaps.openstack.user.UserConfig
83
84       -  name - the username (required)
85       -  password - the user's password (required)
86       -  project\_name - the name of the project to associated to this
87          user (optional)
88       -  domain\_name - the user's domain (default='default')
89       -  email - the user's email address (optional)
90       -  enabled - flag to determine whether or not the user should be
91          enabled (default=True)
92       -  roles - dict where key is the role's name and value is the name
93          the project to associate with the role (optional)
94
95 .. code:: python
96
97     from snaps.config.user import UserConfig
98     from snaps.openstack.create_user import OpenStackUser
99     user_settings = UserConfig(name='username', password='password')
100     user_creator = OpenStackUser(os_creds, user_settings)
101     user_creator.create()
102
103     # Retrieve OS creds for new user for creating other OpenStack instance
104     user_creds = user_creator.get_os_creds(os_creds.project_name)
105
106     # Perform logic
107     ...
108
109     # Cleanup
110     user_creator.clean()
111
112 Create Project
113 --------------
114 -  Project - snaps.openstack.create\_project.OpenStackProject
115
116    -  snaps.openstack.project.ProjectConfig
117
118       -  name - the project name (required)
119       -  domain - the project's domain (default='default')
120       -  description - the project's description (optional)
121       -  enabled - flag to determine whether or not the project should
122          be enabled (default=True)
123
124
125 .. code:: python
126
127     from snaps.openstack.project import ProjectConfig
128     from snaps.openstack.create_project import OpenStackProject
129     project_settings = ProjectConfig(name='username', password='password')
130     project_creator = OpenStackProject(os_creds, project_settings)
131     project_creator.create()
132
133     # Perform logic
134     ...
135
136     # Cleanup
137     project_creator.clean()
138
139 Create Flavor
140 -------------
141 -  Flavor - snaps.openstack.create\_flavor.OpenStackFlavor
142
143    -  snaps.config.flavor.FlavorConfig
144
145       -  name - the flavor name (required)
146       -  flavor\_id - the flavor's string ID (default='auto')
147       -  ram - memory in MB to allocate to VM (required)
148       -  disk - disk storage in GB (required)
149       -  vcpus - the number of CPUs to allocate to VM (required)
150       -  ephemeral - the size of the ephemeral disk in GB (default=0)
151       -  swap - the size of the swap disk in GB (default=0)
152       -  rxtx\_factor - the receive/transmit factor to be set on ports
153          if backend supports QoS extension (default=1.0)
154       -  is\_public - flag that denotes whether or not other projects
155          can access image (default=True)
156       -  metadata - freeform dict() for special metadata (optional)
157
158 .. code:: python
159
160     from snaps.config.flavor import FlavorConfig
161     from snaps.openstack.create_flavor import OpenStackFlavor
162     flavor_settings = FlavorConfig(name='flavor-name', ram=4, disk=10, vcpus=2)
163     flavor_creator = OpenStackFlavor(os_creds, flavor_settings)
164     flavor_creator.create()
165
166     # Perform logic
167     ...
168
169     # Cleanup
170     flavor_creator.clean()
171
172 Create Image
173 ------------
174 -  Image - snaps.openstack.create\_image.OpenStackImage
175
176    -  snaps.config.image.ImageConfig
177
178       -  name - the image name (required)
179       -  image\_user - the default image user generally used by
180          OpenStackVMInstance class for obtaining an SSH connection
181          (required)
182       -  img\_format or format - the image's format (i.e. qcow2) (required)
183       -  url - the download URL to obtain the image file (this or
184          image\_file must be configured, not both)
185       -  image\_file - the location of the file to be sourced from the
186          local filesystem (this or url must be configured, not both)
187       -  extra\_properties - dict() object containing extra parameters to
188          pass when loading the image (i.e. ids of kernel and initramfs images)
189       -  nic\_config\_pb\_loc - the location of the ansible playbook
190          that can configure additional NICs. Floating IPs are required
191          to perform this operation. (optional and deprecated)
192       -  kernel\_image\_settings - the image settings for a kernel image (optional)
193       -  ramdisk\_image\_settings - the image settings for a ramdisk image (optional)
194       -  public - image will be created with public visibility when True (default = False)
195
196
197 .. code:: python
198
199     from snaps.openstack.create_image import OpenStackImage
200     from snaps.config.image import ImageConfig
201     image_settings = ImageConfig(name='image-name', image_user='ubuntu', img_format='qcow2',
202                                  url='http://uec-images.ubuntu.com/releases/trusty/14.04/ubuntu-14.04-server-cloudimg-amd64-disk1.img')
203     image_creator = OpenStackImage(os_creds, image_settings)
204     image_creator.create()
205
206     # Perform logic
207     ...
208
209     # Cleanup
210     image_creator.clean()
211
212 Create Keypair
213 --------------
214 -  Keypair - snaps.openstack.create\_keypair.OpenStackKeypair
215
216    -  snaps.openstack.keypair.KeypairConfig
217
218       -  name - the keypair name (required)
219       -  public\_filepath - the file location to where the public key is
220          to be written or currently resides (optional)
221       -  private\_filepath - the file location to where the private key
222          file is to be written or currently resides (optional but highly
223          recommended to leverage or the private key will be lost
224          forever)
225       -  key\_size - The number of bytes for the key size when it needs to
226          be generated (value must be >=512, default = 1024)
227       -  delete\_on\_clean - when True, the key files will be deleted when
228          OpenStackKeypair#clean() is called (default = False)
229
230 .. code:: python
231
232     from snaps.openstack.keypair.KeypairConfig
233     from snaps.openstack.create_keypairs import OpenStackKeypair
234     keypair_settings = KeypairConfig(name='kepair-name', private_filepath='/tmp/priv-kp')
235     keypair_creator = OpenStackKeypair(os_creds, keypair_settings)
236     keypair_creator.create()
237
238     # Perform logic
239     ...
240
241     # Cleanup
242     keypair_creator.clean()
243
244 Create Network
245 --------------
246
247 -  Network - snaps.openstack.create\_network.OpenStackNetwork
248
249    -  snaps.openstack.create\_network.NetworkSettings
250
251       -  name - the name of the network (required)
252       -  admin\_state\_up - flag denoting the administrative status of
253          the network (True = up, False = down)
254       -  shared - flag indicating whether the network can be shared
255          across projects/tenants (default=True)
256       -  project\_name - the name of the project (optional - can only be
257          set by admin users)
258       -  external - flag determining if network has external access
259          (default=False)
260       -  network\_type - the type of network (i.e. vlan\|vxlan\|flat)
261       -  physical\_network - the name of the physical network (required
262          when network\_type is 'flat')
263       -  segmentation\_id - the id of the segmentation (required
264          when network\_type is 'vlan')
265       -  subnet\_settings (list of optional
266          snaps.openstack.create\_network.SubnetSettings objects)
267
268          -  cidr - the subnet's CIDR (required)
269          -  ip\_version - 4 or 6 (default=4)
270          -  name - the subnet name (required)
271          -  project\_name - the name of the project (optional - can only
272             be set by admin users)
273          -  start - the start address for the allocation pools
274          -  end - the end address for the allocation pools
275          -  gateway\_ip - the gateway IP
276          -  enable\_dhcp - flag to determine whether or not to enable
277             DHCP (optional)
278          -  dns\_nameservers - a list of DNS nameservers
279          -  host\_routes - list of host route dictionaries for subnet
280             (optional, see pydoc and Neutron API for more details)
281          -  destination - the destination for static route (optional)
282          -  nexthop - the next hop for the destination (optional)
283          -  ipv6\_ra\_mode - valid values include: 'dhcpv6-stateful',
284             'dhcp6v-stateless', 'slaac' (optional)
285          -  ipvc\_address\_mode - valid values include:
286             'dhcpv6-stateful', 'dhcp6v-stateless', 'slaac' (optional)
287
288 .. code:: python
289
290     from snaps.openstack.create_network import NetworkSettings, SubnetSettings, OpenStackNetwork
291
292     subnet_settings = SubnetSettings(name='subnet-name', cidr='10.0.0.0/24')
293     network_settings = NetworkSettings(name='network-name', subnet_settings=[subnet_settings])
294
295     network_creator = OpenStackNetwork(os_creds, network_settings)
296     network_creator.create()
297
298     # Perform logic
299     ...
300
301     # Cleanup
302     network_creator.clean()
303
304 Create Security Group
305 ---------------------
306
307 -  Security Group -
308    snaps.openstack.create\_security\_group.OpenStackSecurityGroup
309
310    -  snaps.openstack.create\_security\_group.SecurityGroupSettings
311
312       -  name - the security group's name (required)
313       -  description - the description (optional)
314       -  project\_name - the name of the project (optional - can only be
315          set by admin users)
316       -  rule\_settings (list of
317          optional snaps.openstack.create\_security\_group.SecurityGroupRuleSettings
318          objects)
319
320          -  sec\_grp\_name - the name of the associated security group
321             (required)
322          -  description - the description (optional)
323          -  direction - enum
324             snaps.openstack.create\_security\_group.Direction (required)
325          -  remote\_group\_id - the group ID to associate with this rule
326          -  protocol -
327             enum snaps.openstack.create\_security\_group.Protocol
328             (optional)
329          -  ethertype -
330             enum snaps.openstack.create\_security\_group.Ethertype
331             (optional)
332          -  port\_range\_min - the max port number in the range that is
333             matched by the security group rule (optional)
334          -  port\_range\_max - the min port number in the range that is
335             matched by the security group rule (optional)
336          -  sec\_grp\_rule - the rule object to a security group rule
337             object to associate (note: does not work currently)
338          -  remote\_ip\_prefix - the remote IP prefix to associate with
339             this metering rule packet (optional)
340
341 .. code:: python
342
343     from snaps.openstack.create_security_group import SecurityGroupSettings, SecurityGroupRuleSettings, Direction, OpenStackSecurityGroup
344
345     rule_settings = SubnetSettings(name='subnet-name', cidr='10.0.0.0/24')
346     network_settings = NetworkSettings(name='network-name', subnet_settings=[subnet_settings])
347
348     sec_grp_name = 'sec-grp-name'
349     rule_settings = SecurityGroupRuleSettings(name=sec_grp_name, direction=Direction.ingress)
350     security_group_settings = SecurityGroupSettings(name=sec_grp_name, rule_settings=[rule_settings])
351
352     security_group_creator = OpenStackSecurityGroup(os_creds, security_group_settings)
353     security_group_creator.create()
354
355     # Perform logic
356     ...
357
358     # Cleanup
359     security_group_creator.clean()
360
361 Create Router
362 -------------
363
364 -  Router - snaps.openstack.create\_router.OpenStackRouter
365
366    -  snaps.openstack.create\_router.RouterSettings
367
368       -  name - the router name (required)
369       -  project\_name - the name of the project (optional - can only be
370          set by admin users)
371       -  external\_gateway - the name of the external network (optional)
372       -  admin\_state\_up - flag to denote the administrative status of
373          the router (default=True)
374       -  external\_fixed\_ips - dictionary containing the IP address
375          parameters (parameter not tested)
376       -  internal\_subnets - list of subnet names to which this router
377          will connect (optional)
378       -  port\_settings (list of optional
379          snaps.openstack.create\_router.PortSettings objects) - creates
380          custom ports to internal subnets (similar to internal\_subnets
381          with more control)
382
383          -  name - the port's display name
384          -  network\_name - the name of the network on which to create the port
385          -  admin\_state\_up - A boolean value denoting the administrative
386             status of the port (default = True)
387          -  project\_name - the name of the project (optional - can only
388             be set by admin users)
389          -  mac\_address - the port's MAC address to set (optional and
390             recommended not to set this configuration value)
391          -  ip\_addrs - list of dict() objects containing two keys 'subnet_name'
392             and 'ip' where the value of the 'ip' entry is the expected IP
393             address assigned. This value gets mapped to the fixed\_ips
394             attribute (optional)
395          -  fixed\_ips - dict() where the key is the subnet ID and value is the
396             associated IP address to assign to the port (optional)
397          -  security\_groups - list of security group IDs (not tested)
398          -  allowed\_address\_pairs - A dictionary containing a set of zero or
399             more allowed address pairs. An address pair contains an IP address
400             and MAC address (optional)
401          -  opt\_value - the extra DHCP option value (optional)
402          -  opt\_name - the extra DHCP option name (optional)
403          -  device\_owner - The ID of the entity that uses this port.
404             For example, a DHCP agent (optional)
405          -  device\_id - The ID of the device that uses this port.
406             For example, a virtual server (optional)
407
408 .. code:: python
409
410     from snaps.openstack.create_router import RouterSettings, OpenStackRouter
411
412     router_settings = RouterSettings(name='router-name', external_gateway='external')
413     router_creator = OpenStackRouter(os_creds, router_settings)
414     router_creator.create()
415
416     # Perform logic
417     ...
418
419     # Cleanup
420     router_creator.clean()
421
422 Create QoS Spec
423 ---------------
424
425 -  Volume Type - snaps.openstack.create\_qos.OpenStackQoS
426
427    -  snaps.openstack.create\_qos.QoSSettings
428
429       -  name - the volume type's name (required)
430       -  consumer - the qos's consumer type of the enum type Consumer (required)
431       -  specs - freeform dict() to be added as 'specs' (optional)
432
433 .. code:: python
434
435     from snaps.openstack.create_qos import QoSSettings, OpenStackQoS
436
437     qos_settings = QoSSettings(name='stack-name', consumer=Consumer.front-end)
438     qos_creator = OpenStackQoS(os_creds, vol_type_settings)
439     qos_creator.create()
440
441     # Perform logic
442     ...
443
444     # Cleanup
445     qos_creator.clean()
446
447 Create Volume Type
448 ------------------
449
450 -  Volume Type - snaps.openstack.create\_volume\_type.OpenStackVolumeType
451
452    -  snaps.openstack.create\_volume\_type.VolumeTypeSettings
453
454       -  name - the volume type's name (required)
455       -  description - the volume type's description (optional)
456       -  encryption - instance or config for VolumeTypeEncryptionSettings (optional)
457       -  qos\_spec\_name - name of the QoS Spec to associate (optional)
458       -  public - instance or config for VolumeTypeEncryptionSettings (optional)
459
460 .. code:: python
461
462     from snaps.openstack.create_volume_type import VolumeTypeSettings, OpenStackVolumeType
463
464     vol_type_settings = VolumeTypeSettings(name='stack-name')
465     vol_type_creator = OpenStackHeatStack(os_creds, vol_type_settings)
466     vol_type_creator.create()
467
468     # Perform logic
469     ...
470
471     # Cleanup
472     vol_type_creator.clean()
473
474 Create Volume
475 -------------
476
477 -  Volume - snaps.openstack.create\_volume.OpenStackVolume
478
479    -  snaps.openstack.create\_volume.VolumeSettings
480
481       -  name - the volume type's name (required)
482       -  description - the volume type's description (optional)
483       -  size - size of volume in GB (default = 1)
484       -  image_name - when a glance image is used for the image source (optional)
485       -  type\_name - the associated volume's type name (optional)
486       -  availability\_zone - the name of the compute server on which to
487          deploy the volume (optional)
488       -  multi_attach - when true, volume can be attached to more than one
489          server (default = False)
490
491 .. code:: python
492
493     from snaps.openstack.create\_volume import VolumeSettings, OpenStackVolume
494
495     vol_settings = VolumeSettings(name='stack-name')
496     vol_creator = OpenStackVolume(os_creds, vol_settings)
497     vol_creator.create()
498
499     # Perform logic
500     ...
501
502     # Cleanup
503     vol_type_creator.clean()
504
505 Create Heat Stack
506 -----------------
507
508 -  Heat Stack - snaps.openstack.create\_stack.OpenStackHeatStack
509
510    -  snaps.openstack.create\_stack.StackSettings
511
512       -  name - the stack's name (required)
513       -  template - the heat template in dict() format (required when
514          template_path is None)
515       -  template\_path - the location of the heat template file (required
516          when template is None)
517       -  env\_values - dict() of strings for substitution of template
518          default values (optional)
519
520 .. code:: python
521
522     from snaps.openstack.create_stack import StackSettings, OpenStackHeatStack
523
524     stack_settings = StackSettings(name='stack-name', template_path='/tmp/template.yaml')
525     stack_creator = OpenStackHeatStack(os_creds, stack_settings)
526     stack_creator.create()
527
528     # Perform logic
529     ...
530
531     # Cleanup
532     stack_creator.clean()
533
534 Create VM Instance
535 ------------------
536
537 -  VM Instances - snaps.openstack.create\_instance.OpenStackVmInstance
538
539    -  snaps.openstack.create\_instance.VmInstanceSettings
540
541       -  name - the name of the VM (required)
542       -  flavor - the name of the flavor (required)
543       -  port\_settings - list of
544          snaps.openstack.create\_network.PortSettings objects where each
545          denote a NIC (see above in create router section for details)
546          API does not require, but newer NFVIs now require VMs have at
547          least one network
548       -  security\_group\_names - a list of security group names to
549          apply to VM
550       -  floating\_ip\_settings (list of
551          snaps.openstack\_create\_instance.FloatingIpSettings objects)
552
553          -  name - a name to a floating IP for easy lookup 
554          -  port\_name - the name of the VM port on which the floating
555             IP should be applied (required)
556          -  router\_name - the name of the router to the external
557             network (required)
558          -  subnet\_name - the name of the subnet on which to attach the
559             floating IP (optional)
560          -  provisioning - when true, this floating IP will be used for
561             provisioning which will come into play once we are able to
562             get multiple floating IPs working.
563
564       -  sudo\_user - overrides the image\_settings.image\_user value
565          when attempting to connect via SSH
566       -  vm\_boot\_timeout - the number of seconds that the thread will
567          block when querying the VM's status when building (default=900)
568       -  vm\_delete\_timeout - the number of seconds that the thread
569          will block when querying the VM's status when deleting
570          (default=300)
571       -  ssh\_connect\_timeout - the number of seconds that the thread
572          will block when attempting to obtain an SSH connection
573          (default=180)
574       -  availability\_zone - the name of the compute server on which to
575          deploy the VM (optional must be admin)
576       -  userdata - the cloud-init script to execute after VM has been
577          started
578
579    -  image\_settings - see snaps.config.image.ImageConfig
580       above (required)
581    -  keypair\_settings - see
582       snaps.openstack.keypair.KeypairConfig above (optional)
583
584 .. code:: python
585
586     from snaps.openstack.create_instance import VmInstanceSettings, FloatingIpSettings, OpenStackVmInstance
587     from snaps.openstack.create_network import PortSettings
588
589     port_settings = PortSettings(name='port-name', network_name=network_settings.name)
590     floating_ip_settings = FloatingIpSettings(name='fip1', port_name=port_settings.name, router_name=router_settings.name)
591     instance_settings = VmInstanceSettings(name='vm-name', flavor='flavor_settings.name', port_settings=[port_settings],
592                                            floating_ip_settings=[floating_ip_settings])
593
594     instance_creator = OpenStackVmInstance(os_creds, instance_settings, image_settings, kepair_settings)
595     instance_creator.create()
596
597     # Perform logic
598     ...
599     ssh_client = instance_creator.ssh_client()
600     ...
601
602     # Cleanup
603     instance_creator.clean()
604
605 Ansible Provisioning
606 ====================
607
608 Being able to easily create OpenStack instances such as virtual networks
609 and VMs is a good start to the problem of NFV; however, an NFVI is
610 useless unless there is some software performing some function. This is
611 why we added Ansible playbook support to SNAPS-OO which can be located
612 in snaps.provisioning.ansible\_utils#apply\_playbook. See below for a
613 description of that function's parameters:
614
615 -  playbook\_path - the file location of the ansible playbook
616 -  hosts\_inv - a list of hosts/IP addresses to which the playbook will
617    be applied
618 -  host\_user - the user (preferably sudo) to use for applying the
619    playbook
620 -  ssh\_priv\_key\_file\_path - the location to the private key file
621    used for SSH
622 -  variables - a dict() of substitution values for Jinga2 templates
623    leveraged by Ansible
624 -  proxy\_setting - used to extract the SSH proxy command (optional)
625
626 Apply Ansible Playbook Utility
627 ------------------------------
628
629 .. code:: python
630
631     from snaps.provisioning import ansible_utils
632
633     ansible_utils.apply_playbook(playbook_path='provisioning/tests/playbooks/simple_playbook.yml',
634                                  hosts_inv=[ip], host_user=user, ssh_priv_key_file_path=priv_key,
635                                  proxy_setting=self.os_creds.proxy_settings)
636
637 OpenStack Utilities
638 ===================
639
640 For those who do like working procedurally, SNAPS-OO also leverages
641 utilitarian functions for nearly every query or request made to
642 OpenStack. This pattern will make it easier to deal with API version
643 changes as they would all be made in one place. (see keystone\_utils for
644 an example of this pattern as this is the only API where SNAPS is
645 supporting more than one version)
646
647 -  snaps.openstack.utils.keystone\_utils - for calls to the Keystone
648    APIs (support for versions 2 & 3)
649 -  snaps.openstack.utils.glance\_utils - for calls to the Glance APIs
650    (support for versions 1 & 2)
651 -  snaps.openstack.utils.neutron\_utils - for calls to the Neutron APIs
652    (version 2)
653 -  snaps.openstack.utils.nova\_utils - for calls to the Nova APIs (version 2)
654 -  snaps.openstack.utils.heat\_utils - for calls to the Heat APIs (version 1)
655 -  snaps.openstack.utils.cinder\_utils - for calls to the Cinder APIs
656    (support for versions 2 & 3)