azureclient

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package azure provides Azure SDK integration for AKS MCP server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureCache

type AzureCache struct {
	// contains filtered or unexported fields
}

Cache is a simple in-memory cache for Azure resources.

func NewAzureCache

func NewAzureCache(timeout time.Duration) *AzureCache

NewAzureCache creates a new cache with the specified timeout.

func (*AzureCache) Clear

func (c *AzureCache) Clear()

Clear removes all values from the cache.

func (*AzureCache) Delete

func (c *AzureCache) Delete(key string)

Delete removes a value from the cache.

func (*AzureCache) Get

func (c *AzureCache) Get(key string) (interface{}, bool)

Get retrieves a value from the cache. Returns the value and true if the item exists and hasn't expired. Returns nil and false otherwise.

func (*AzureCache) Set

func (c *AzureCache) Set(key string, value interface{})

Set adds or updates a value in the cache with the default expiration time.

func (*AzureCache) SetWithExpiration

func (c *AzureCache) SetWithExpiration(key string, value interface{}, duration time.Duration)

SetWithExpiration adds or updates a value in the cache with a custom expiration time.

type AzureClient

type AzureClient struct {
	// contains filtered or unexported fields
}

AzureClient represents an Azure API client that can handle multiple subscriptions.

func NewAzureClient

func NewAzureClient(cfg *config.ConfigData) (*AzureClient, error)

NewAzureClient creates a new Azure client using default credentials and the provided configuration.

func (*AzureClient) GetAKSCluster

func (c *AzureClient) GetAKSCluster(ctx context.Context, subscriptionID, resourceGroup, clusterName string) (*armcontainerservice.ManagedCluster, error)

GetAKSCluster retrieves information about the specified AKS cluster.

func (*AzureClient) GetLoadBalancer

func (c *AzureClient) GetLoadBalancer(ctx context.Context, subscriptionID, resourceGroup, lbName string) (*armnetwork.LoadBalancer, error)

GetLoadBalancer retrieves information about the specified load balancer.

func (*AzureClient) GetNetworkSecurityGroup

func (c *AzureClient) GetNetworkSecurityGroup(ctx context.Context, subscriptionID, resourceGroup, nsgName string) (*armnetwork.SecurityGroup, error)

GetNetworkSecurityGroup retrieves information about the specified network security group.

func (*AzureClient) GetOrCreateClientsForSubscription

func (c *AzureClient) GetOrCreateClientsForSubscription(subscriptionID string) (*SubscriptionClients, error)

GetOrCreateClientsForSubscription gets existing clients for a subscription or creates new ones.

func (*AzureClient) GetResourceByID

func (c *AzureClient) GetResourceByID(ctx context.Context, resourceID string) (interface{}, error)

GetResourceByID retrieves a resource by its full Azure resource ID. It parses the ID, determines the resource type, and calls the appropriate method.

func (*AzureClient) GetRouteTable

func (c *AzureClient) GetRouteTable(ctx context.Context, subscriptionID, resourceGroup, routeTableName string) (*armnetwork.RouteTable, error)

GetRouteTable retrieves information about the specified route table.

func (*AzureClient) GetSubnet

func (c *AzureClient) GetSubnet(ctx context.Context, subscriptionID, resourceGroup, vnetName, subnetName string) (*armnetwork.Subnet, error)

GetSubnet retrieves information about the specified subnet in a virtual network.

func (*AzureClient) GetVirtualNetwork

func (c *AzureClient) GetVirtualNetwork(ctx context.Context, subscriptionID, resourceGroup, vnetName string) (*armnetwork.VirtualNetwork, error)

GetVirtualNetwork retrieves information about the specified virtual network.

type SubscriptionClients

type SubscriptionClients struct {
	SubscriptionID         string
	ContainerServiceClient *armcontainerservice.ManagedClustersClient
	VNetClient             *armnetwork.VirtualNetworksClient
	SubnetsClient          *armnetwork.SubnetsClient
	RouteTableClient       *armnetwork.RouteTablesClient
	NSGClient              *armnetwork.SecurityGroupsClient
	LoadBalancerClient     *armnetwork.LoadBalancersClient
}

SubscriptionClients contains Azure clients for a specific subscription.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL