2023-03-07 05:37:08 -05:00
|
|
|
/*
|
|
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
|
|
|
package openstack
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/edgelesssys/constellation/v2/internal/role"
|
2024-08-08 04:37:09 -04:00
|
|
|
"github.com/gophercloud/gophercloud/v2/openstack/compute/v2/servers"
|
|
|
|
"github.com/gophercloud/gophercloud/v2/openstack/networking/v2/networks"
|
|
|
|
"github.com/gophercloud/gophercloud/v2/openstack/networking/v2/subnets"
|
|
|
|
"github.com/gophercloud/gophercloud/v2/pagination"
|
2023-03-07 05:37:08 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
type imdsAPI interface {
|
|
|
|
providerID(ctx context.Context) (string, error)
|
|
|
|
name(ctx context.Context) (string, error)
|
|
|
|
projectID(ctx context.Context) (string, error)
|
|
|
|
uid(ctx context.Context) (string, error)
|
|
|
|
initSecretHash(ctx context.Context) (string, error)
|
|
|
|
role(ctx context.Context) (role.Role, error)
|
|
|
|
vpcIP(ctx context.Context) (string, error)
|
2024-02-22 11:39:34 -05:00
|
|
|
loadBalancerEndpoint(ctx context.Context) (string, error)
|
2023-03-07 05:37:08 -05:00
|
|
|
}
|
2023-03-07 05:37:25 -05:00
|
|
|
|
|
|
|
type serversAPI interface {
|
|
|
|
ListServers(opts servers.ListOptsBuilder) pagerAPI
|
2024-02-15 04:43:48 -05:00
|
|
|
ListNetworks(opts networks.ListOptsBuilder) pagerAPI
|
2023-03-07 05:37:25 -05:00
|
|
|
ListSubnets(opts subnets.ListOpts) pagerAPI
|
|
|
|
}
|
|
|
|
|
|
|
|
type pagerAPI interface {
|
2024-08-08 04:37:09 -04:00
|
|
|
AllPages(context.Context) (pagination.Page, error)
|
2023-03-07 05:37:25 -05:00
|
|
|
}
|