2023-03-07 05:37:25 -05:00
|
|
|
/*
|
|
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
|
|
|
package openstack
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/gophercloud/gophercloud"
|
|
|
|
"github.com/gophercloud/gophercloud/openstack/compute/v2/servers"
|
2024-02-15 04:43:48 -05:00
|
|
|
"github.com/gophercloud/gophercloud/openstack/networking/v2/networks"
|
2023-03-07 05:37:25 -05:00
|
|
|
"github.com/gophercloud/gophercloud/openstack/networking/v2/subnets"
|
|
|
|
)
|
|
|
|
|
|
|
|
type apiClient struct {
|
2024-02-15 04:43:48 -05:00
|
|
|
servers *gophercloud.ServiceClient
|
|
|
|
networks *gophercloud.ServiceClient
|
2023-03-07 05:37:25 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func (c *apiClient) ListServers(opts servers.ListOptsBuilder) pagerAPI {
|
|
|
|
return servers.List(c.servers, opts)
|
|
|
|
}
|
|
|
|
|
2024-02-15 04:43:48 -05:00
|
|
|
func (c *apiClient) ListNetworks(opts networks.ListOptsBuilder) pagerAPI {
|
|
|
|
return networks.List(c.networks, opts)
|
|
|
|
}
|
|
|
|
|
2023-03-07 05:37:25 -05:00
|
|
|
func (c *apiClient) ListSubnets(opts subnets.ListOpts) pagerAPI {
|
2024-02-15 04:43:48 -05:00
|
|
|
return subnets.List(c.networks, opts)
|
2023-03-07 05:37:25 -05:00
|
|
|
}
|