github.com/gophercloud/gophercloud@v1.11.0/openstack/baremetalintrospection/v1/introspection/doc.go (about)

     1  /*
     2  Package introspection contains the functionality for Starting introspection,
     3  Get introspection status, List all introspection statuses, Abort an
     4  introspection, Get stored introspection data and reapply introspection on
     5  stored data.
     6  
     7  API reference https://developer.openstack.org/api-ref/baremetal-introspection/#node-introspection
     8  
     9  Example to Start Introspection
    10  
    11  	err := introspection.StartIntrospection(client, NodeUUID, introspection.StartOpts{}).ExtractErr()
    12  	if err != nil {
    13  		panic(err)
    14  	}
    15  
    16  Example to Get an Introspection status
    17  
    18  	_, err := introspection.GetIntrospectionStatus(client, NodeUUID).Extract()
    19  	if err != nil {
    20  		panic(err)
    21  	}
    22  
    23  Example to List all introspection statuses
    24  
    25  	introspection.ListIntrospections(client.ServiceClient(), nil).EachPage(func(page pagination.Page) (bool, error) {
    26  		introspectionsList, err := introspection.ExtractIntrospections(page)
    27  		if err != nil {
    28  			return false, err
    29  		}
    30  
    31  		for _, n := range introspectionsList {
    32  			// Do something
    33  		}
    34  
    35  		return true, nil
    36  	})
    37  
    38  Example to Abort an Introspection
    39  
    40  	err := introspection.AbortIntrospection(client, NodeUUID).ExtractErr()
    41  	if err != nil {
    42  		panic(err)
    43  	}
    44  
    45  Example to Get stored Introspection Data
    46  
    47  	v, err := introspection.GetIntrospectionData(c, NodeUUID).Extract()
    48  	if err != nil {
    49  		panic(err)
    50  	}
    51  
    52  Example to apply Introspection Data
    53  
    54  	err := introspection.ApplyIntrospectionData(c, NodeUUID).ExtractErr()
    55  	if err != nil {
    56  		panic(err)
    57  	}
    58  */
    59  package introspection