networkget

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package networkget makes the tool cloud agnostic for fetching network details. The decision will be made here to route the request to respective package based on input.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetNetworksInput

type GetNetworksInput struct {
	// Ids or names of VPC's of which the information has to be fetched.
	VpcIds []string `json:"vpcids"`

	// Ids or names of the SUBNET's of which the informaion has to be fetched.
	SubnetIds []string `json:"subnetids"`

	Cloud cmn.Cloud
}

GetNetworksInput implements method GetNetworks, GetSubnets.

func New

func New() *GetNetworksInput

New returns the new GetNetworksInput instance with empty values

func (GetNetworksInput) GetAllNetworks

func (net GetNetworksInput) GetAllNetworks() ([]GetNetworksResponse, error)

GetAllNetworks will fetch the details of all networks across all regions from the cloud specified. appropriate user and his cloud profile details which was passed while calling it.

func (*GetNetworksInput) GetNetworks

func (net *GetNetworksInput) GetNetworks() (GetNetworksResponse, error)

GetNetworks is responsible for fetching the details of a particular network passed or all the details of the networks present in the region. appropriate user and his cloud profile details which was passed while calling it.

func (GetNetworksInput) GetSubnets

func (sub GetNetworksInput) GetSubnets() (GetSubnetsResponse, error)

GetSubnets will fetch the details of subnets specified else it pull the data out for all subnets in that particulat region and give back the response who called this. Below method will take care of fetching details of appropriate user and his cloud profile details which was passed while calling it.

type GetNetworksResponse

type GetNetworksResponse struct {
	// Contains filtered/unfiltered response of AWS.
	AwsResponse []network.NetworkResponse `json:"AwsResponse,omitempty"`

	// Contains filtered/unfiltered response of Azure.
	AzureResponse string `json:"AzureResponse,omitempty"`

	// Default response if no inputs or matching the values required.
	DefaultResponse string `json:"DefaultResponse,omitempty"`
}

GetNetworksResponse will return the filtered/unfiltered responses of variuos clouds.

type GetSubnetsResponse

type GetSubnetsResponse struct {
	// Contains filtered/unfiltered response of AWS.
	AwsResponse network.NetworkResponse `json:"AwsResponse,omitempty"`

	// Contains filtered/unfiltered response of Azure.
	AzureResponse string `json:"AzureResponse,omitempty"`

	// Default response if no inputs or matching the values required.
	DefaultResponse string `json:"DefaultResponse,omitempty"`
}

GetSubnetsResponse will return the filtered/unfiltered responses of variuos clouds.

Jump to

Keyboard shortcuts

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