GithubHelp home page GithubHelp logo

a10netclient's Introduction

A10NetClient

A10 aXAPI .Net Client

How to use:

Add a refferance to your .Net project the A10NetClient.dll Now you can build a new instane of A10Client

Example

Senario: To Get a List of Servers behind a virutal server address.

First we will initial an A10ClientBuilder class, by filling user name, password and A10 Ip address.

A10ClientBuilder A10Client = new A10ClientBuilder();
A10Client.Authentication("[USERNAME]", "[PASSWORD]");
A10Client.IpAddress("[IPADDRRESS]");
Session clientSession = A10Client.Build().Session;

Next, we will get a virtual server object by enter an virtual Server Ip address,

var vserver = VirtualServers.FromJson(
clientSession.VirtualServer.GETexecute(GETActionType.search, 
new Dictionary<string, string> { { "address", "[VIRTUAL SERVER IP ADDRESS]" } }));

Next, from a previous step we will use a service Group name and with it we will return an object of service Group,

var servGrp = ServicesGroup.FromJson(
clientSession.ServiceGroup.GETexecute(
GETActionType.search, new Dictionary<string, string>{ { "name", vserver.VirtualServer.VportList[0].Name } }));

Final step, from a previous step we will use memeber servers and return for each an object of server

foreach (MemberList member in servGrp.ServiceGroup.MemberList)
{
	Console.WriteLine(Servers.FromJson(
		clientSession.Server.GETexecute(GETActionType.search, new Dictionary<string, string>
		{ { "name",member.Server } })).Server.Host);
}

Not forget to close the session

clientSession.Close();

Full Eaxmple:

A10ClientBuilder A10Client = new A10ClientBuilder();
A10Client.Authentication("[USERNAME]", "[PASSWORD]");
A10Client.IpAddress("[IPADDRRESS]");
Session clientSession = A10Client.Build().Session;
var vserver = VirtualServers.FromJson(clientSession.VirtualServer.GETexecute(GETActionType.search, new Dictionary<string, string> { 		{ "address", "[VIRTUAL SERVER IP ADDRESS]" } }));
var servGrp = ServicesGroup.FromJson(clientSession
 .ServiceGroup.GETexecute(GETActionType.search, new Dictionary<string, string>
	 { { "name", vserver.VirtualServer.VportList[0].Name } }));
foreach (MemberList member in servGrp.ServiceGroup.MemberList)
{
		Console.WriteLine(Servers.FromJson(
				clientSession.Server.GETexecute(GETActionType.search, new Dictionary<string, string>
				{ { "name",member.Server } })).Server.Host);
}

clientSession.Close();

a10netclient's People

Contributors

uretzkyzvi avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.