1 #ifndef METADATA_INCLUDED
2 #define METADATA_INCLUDED
3 /**************************************************************************//**
5 * Wrap the OpenStack metadata service.
10 * Copyright(c) <2016>, AT&T Intellectual Property. All other rights reserved.
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions are met:
15 * 1. Redistributions of source code must retain the above copyright notice,
16 * this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 * 3. All advertising materials mentioning features or use of this software
21 * must display the following acknowledgement: This product includes
22 * software developed by the AT&T.
23 * 4. Neither the name of AT&T nor the names of its contributors may be used to
24 * endorse or promote products derived from this software without specific
25 * prior written permission.
27 * THIS SOFTWARE IS PROVIDED BY AT&T INTELLECTUAL PROPERTY ''AS IS'' AND ANY
28 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
29 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30 * DISCLAIMED. IN NO EVENT SHALL AT&T INTELLECTUAL PROPERTY BE LIABLE FOR ANY
31 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
32 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
33 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
34 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
36 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 *****************************************************************************/
42 /**************************************************************************//**
43 * Download metadata from the OpenStack metadata service.
45 * @param verbosity Controls whether to generate debug to stdout. Zero:
46 * none. Non-zero: generate debug.
47 * @returns Status code
48 * @retval EVEL_SUCCESS On success
49 * @retval ::EVEL_ERR_CODES On failure.
50 *****************************************************************************/
51 EVEL_ERR_CODES openstack_metadata(int verbosity);
53 /**************************************************************************//**
54 * Initialize default values for vm_name and vm_uuid - for testing purposes.
55 *****************************************************************************/
56 void openstack_metadata_initialize();
58 /**************************************************************************//**
59 * Get the VM name provided by the metadata service.
62 *****************************************************************************/
63 const char *openstack_vm_name();
65 /**************************************************************************//**
66 * Get the VM UUID provided by the metadata service.
69 *****************************************************************************/
70 const char *openstack_vm_uuid();