netscaler automaon - virtues.it...generic content-type: applicaon/ json (netscaler 10.1+)...

50
NetScaler Automa.on USING POWERSHELL TO TALK NITRO

Upload: others

Post on 30-Jun-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

NetScaler Automa.on USING POWERSHELL TO TALK NITRO

Page 2: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

2#CitrixSynergy-May24th,2017 #SYN325

Tweetaboutthissessionwithhashtags#syn325and#citrixsynergy

StockImageComp

Page 3: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

3#CitrixSynergy-May24th,2017 #SYN325

§  20 years of Technical Consulting

§  Solutions Architect at PepperByte §  MSc Computer Science §  Design | Implement | Troubleshooting

§  5+ years of DevOps scripting fun §  Automating Windows Server Deployments §  Automating Citrix Deployments §  Automating NetScaler Deployments

YourPresenter: EstherBarthel SoluConsArchitect

@virtuEs_IT hKp://nl.linkedin.com/in/ebarthel hKp://www.virtues.it

About Esther

Page 4: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

Agenda

q Introduc>onq RESTfulAPIs&NITROq PowerShellNetScalerModule

q Automa>ngNetScalerConfigura>onsq BasicSystemSeKngsq LoadBalancingSeKngsq NetScalerGatewaySeKngs

q BonusSlidesq DeployingNetScalerVPXwithfixedIP-addressq CPXLoadBalancing

Page 5: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

Introduc.on REST API & NITRO

Page 6: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

6#CitrixSynergy-May24th,2017 #SYN325

 REpresentaConalStateTransfer(REST):◦  Client-Server◦  Stateless◦  PlaSorm&language-independent◦  Standards-based(runsontopofHTTPprotocol)◦  Easilyusedinpresenceoffirewalls(port80or443)

 NITRO(RESTfulserviceonNetScaler):◦  CommunicatewithNetScalerprogramma>cally◦  HumanreadableHTTP-basedinterac>on◦  NITROSDKsavailableformul>plelanguages(Java,Python,.NET,REST)

RESTful APIs

Introduction > Automation > Bonus

NITROWebService

ClientApplicaCon

RESTrequest

RESTresponse

Page 7: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

7#CitrixSynergy-May24th,2017 #SYN325

 AwaytointeractwithanAPIviaseriesofHTTPcalls

◦  VERB:HTTPMethod(GET,POST,PUT,DELETE,OPTIONS)◦  URI:resourceonwhichtheopera>onisperformed◦  HTTPVersion:usually"HTTP/1.1"◦  RequestHeader:containsmetadata(formaKng,etc.)◦  RequestBody:actualmessagecontent

RESTful APIs

Introduction > Automation > Bonus

<VERB> <URI> <HTTP Version>

<Request Header>

<Request Body>

Page 8: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

8#CitrixSynergy-May24th,2017 #SYN325

 AwaytointeractwithanAPIviaseriesofHTTPcalls

◦  HTTPMethod(GET,POST,PUT,DELETE)

NITRO

Introduction > Automation > Bonus

◦  URL:hbp(s)://<ns-ipaddress>/nitro/v1/config/nsfeature?acCon=enable

◦  AddabasicURLstemtousewithNITRO:◦  hbp://<NSIP>/nitro/v1/stat/ –>en>tyandsystemsta>s>cs◦  hbp://<NSIP>/nitro/v1/config/ –>configura>onopera>ons

◦  AddtheresourcetypetotheURL (andinsomecasesalsotheresourcename)

◦  SpecifyanacConfortheURL (bind,unset,enable,disable)

Page 9: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

9#CitrixSynergy-May24th,2017 #SYN325

 AwaytointeractwithanAPIviaseriesofHTTPcalls

◦  SpecifytheContent-TypeintheRequestHeader:

◦  Content-Type:applica>on/vnd.com.citrix.netscaler.nsfeature+json

◦  AddtheJSONpayloadtotheRequestBody:

NITRO

Introduction > Automation > Bonus

genericcontent-type:applicaCon/json (NetScaler10.1+)

Page 10: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

10#CitrixSynergy-May24th,2017 #SYN325

 AwaytointeractwithanAPIviaseriesofHTTPcalls

NITRO

Introduction > Automation > Bonus

Page 11: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

11#CitrixSynergy-May24th,2017 #SYN325

NITRO API Documenta.on

Introduction > Automation > Bonus

Page 12: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

12#CitrixSynergy-May24th,2017 #SYN325

Citrix Blog

Introduction > Automation > Bonus

source:hbps://github.com/san>agocardenas/netscaler-configura>on

Page 13: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

13#CitrixSynergy-May24th,2017 #SYN325

 WhatisincludedinthePowerShellModulefromtheCitrixBlog?

NetScaler Automa.on w/ PowerShell

Introduction > Automation > Bonus

GlobalNetScalerFeatures NetScalerIPAddresses

Hostname Timezone

DNSNameServer LoadBalancing

Monitors Cer>ficates

LDAPAuthen>ca>on Gateway

POST

Page 14: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

14#CitrixSynergy-May24th,2017 #SYN325

 WhatisincludedinthePowerShellModulefromtheCitrixBlog?WhatisincludedinthePS-NITROPowerShellModule?

NetScaler Automa.on w/ PowerShell

Introduction > Automation > Bonus

GlobalNetScalerFeatures NetScalerIPAddresses

Hostname Timezone

DNSNameServer LoadBalancing

Monitors Cer>ficates

LDAPAuthen>ca>on Gateway

FileUploads(.cert,.key,.txt,.lic) SystemBackup

NTPServers SystemUsers&Groups

Responder&Rewrite DNSNameRecords

ContentSwitching GlobalServerLoadBalancing

PUTGET

DELETEPOST

Page 15: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

Automa.ng NetScaler Configura.ons

A BASIC EXAMPLE

Page 16: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

16#CitrixSynergy-May24th,2017 #SYN325

GlobalNetScalerFeatures

NetScaler Automa.on w/ NITRO

Introduction > Automation > Bonus

Page 17: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

17#CitrixSynergy-May24th,2017 #SYN325

GlobalNetScalerFeatures

NetScaler Automa.on w/ PowerShell Module

Introduction > Automation > Bonus

Page 18: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

18#CitrixSynergy-May24th,2017 #SYN325

PowerShell in Ac.on

Introduction > Automation > Bonus

Page 19: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

Automa.ng NetScaler Configura.ons

LOAD BALANCING

Page 20: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

20#CitrixSynergy-May24th,2017 #SYN325

NetScalerLoadBalancing

NetScaler Automa.on w/ PowerShell

Introduction > Automation > Bonus

Page 21: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

21#CitrixSynergy-May24th,2017 #SYN325

NetScalerLoadBalancing–Rewrite&Responderpolicies

NetScaler Automa.on w/ PowerShell

Introduction > Automation > Bonus

Page 22: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

22#CitrixSynergy-May24th,2017 #SYN325

NetScalerLoadBalancing–Servers,Services&ServiceGroups

NetScaler Automa.on w/ PowerShell

Introduction > Automation > Bonus

Page 23: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

23#CitrixSynergy-May24th,2017 #SYN325

NetScalerLoadBalancing–Monitors&vServers

NetScaler Automa.on w/ PowerShell

Introduction > Automation > Bonus

Page 24: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

24#CitrixSynergy-May24th,2017 #SYN325

PowerShell in Ac.on

Introduction > Automation > Bonus

Page 25: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

Automa.ng NetScaler Configura.ons

U S I N G INVOKE-RESTMETHOD C M D L E T

Page 26: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

26#CitrixSynergy-May24th,2017 #SYN325

JSON Array & Hastable formaRng

Introduction > Automation > Bonus

Page 27: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

27#CitrixSynergy-May24th,2017 #SYN325

JSON Array & Hastable formaRng

Introduction > Automation > Bonus

Page 28: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

28#CitrixSynergy-May24th,2017 #SYN325

Convert-To Json cmdlet

Introduction > Automation > Bonus

Page 29: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

29#CitrixSynergy-May24th,2017 #SYN325

Convert-To Json cmdlet - Depth parameter

Introduction > Automation > Bonus

Page 30: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

30#CitrixSynergy-May24th,2017 #SYN325

GlobalNetScalerFeatures

NetScaler Automa.on w/ NITRO

Introduction > Automation > Bonus

Page 31: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

31#CitrixSynergy-May24th,2017 #SYN325

NetScaler Automa.on w/ PowerShell & REST

Introduction > Automation > Bonus

Page 32: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

Automa.ng NetScaler Configura.ons

NETSCALER GATEWAY

Page 33: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

33#CitrixSynergy-May24th,2017 #SYN325

NetScalerGateway

NetScaler Automa.on w/ PowerShell

Introduction > Automation > Bonus

Page 34: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

34#CitrixSynergy-May24th,2017 #SYN325

NetScalerGateway

NetScaler Automa.on w/ PowerShell

Introduction > Automation > Bonus

Page 35: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

35#CitrixSynergy-May24th,2017 #SYN325

PowerShell in Ac.on

Introduction > Automation > Bonus

Page 36: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

The Scripts WHERE TO GO NEXT?

Page 37: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

37#CitrixSynergy-May24th,2017 #SYN325

UploadingthePowerShellModuleandScriptsaoerthepresentaCon

GitHub

Introduction > Automation > Bonus

SharingtheextendedPowerShellModuleanddemoScriptswiththeCommunity:

hKps://github.com/cogniConIT/PS-NITRO

Page 38: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

Presentedby: EstherBarthel SoluConsArchitect

@virtuEs_IT hKp://nl.linkedin.com/in/ebarthel hKp://www.virtues.it

Page 39: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

Bonus Slides AUTOMATE DEPLOYMENTS

Page 40: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

40#CitrixSynergy-May24th,2017 #SYN325

CTX128236:HowToAuto-ProvisionNetScalerVPXonXenServer

Bonus: NetScaler VPX with fixed IP (Hypervisors)

Introduction > Automation > Bonus

source:hbp://www.virtues.it/2015/11/ps-import-ns-vpx-fixed-ip-on-xs/

Page 41: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

41#CitrixSynergy-May24th,2017 #SYN325

CTX128250:HowToAuto-ProvisionNetScalerVPXonESXorESXiHost

Bonus: NetScaler VPX with fixed IP (Hypervisors)

Introduction > Automation > Bonus

source:hbp://www.virtues.it/2016/01/ps-import-ns-vpx-fixed-ip-esxi/

Page 42: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

42#CitrixSynergy-May24th,2017 #SYN325

CitrixProductDocumentaCon:SDX11.1–NITROAPIDocumentaCon

Bonus: NetScaler VPX with fixed IP (NS SDX)

Introduction > Automation > Bonus

source:hbps://docs.citrix.com/en-us/sdx/11-1/nitro-api-doc/nitro-rest-api.html

Page 43: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

43#CitrixSynergy-May24th,2017 #SYN325

CitrixProductDocumentaCon:

Bonus: NetScaler VPX with fixed IP (Hyper-V)

Introduction > Automation > Bonus

source:hbps://docs.citrix.com/en-us/netscaler/12/deploying-vpx/install-vpx-on-hyper-v.html

Page 44: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

Bonus Slides CPX LOAD BALANCING

Page 45: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

45#CitrixSynergy-May24th,2017 #SYN325

NetScalerCPXLoadBalancing

NetScaler Automa.on w/ PowerShell

Introduction > Automation > Bonus

Page 46: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

46#CitrixSynergy-May24th,2017 #SYN325

NetScalerCPXLoadBalancing–LBvServer

NetScaler Automa.on w/ PowerShell

Introduction > Automation > Bonus

Page 47: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

47#CitrixSynergy-May24th,2017 #SYN325

NetScalerCPXLoadBalancing–LBvServer

NetScaler Automa.on w/ PowerShell

Introduction > Automation > Bonus

Page 48: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

48#CitrixSynergy-May24th,2017 #SYN325

PowerShell in Ac.on

Introduction > Automation > Bonus

Page 49: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

49 ©2017Citrix

Beforeyouleave…

Pleaseratethissessioninthemobileapp

Page 50: NetScaler Automaon - virtuEs.IT...generic content-type: applicaon/ json (NetScaler 10.1+) #CitrixSynergy - May 24 th , 2017 #SYN325 10 A way to interact with an API via series of HTTP

50 ©2016Citrix|Confiden>al

“Itwasanopportunitytobringtogetherlike-mindedpeople,network,sharestories,andhelpeachother.”–CUGCMember

Fortheusers,bytheusers

•  16,000+membersglobally•  60+localusergroupsandspecialinterestgroups(SIGs)•  Knowledgesharing,expertdiscussion•  Networkingatlocalmee>ngs,conferencesandtechnologyevents•  Technicalwebinars,forumsandblogs•  Opportuni>estoshare,learn,mentorandlead

FindusattheCommunityHubinSynergyPark!