{"id":8175,"date":"2024-06-30T17:47:44","date_gmt":"2024-06-30T14:47:44","guid":{"rendered":"https:\/\/sunucucozumleri.com\/?p=8175"},"modified":"2024-06-30T17:47:44","modified_gmt":"2024-06-30T14:47:44","slug":"vcenter-api-komutlari","status":"publish","type":"post","link":"https:\/\/sunucucozumleri.com\/blog\/vcenter-api-komutlari\/","title":{"rendered":"Vcenter API Komutlar\u0131"},"content":{"rendered":"<p>Bu yaz\u0131da <strong>vCenter API Komutlar\u0131<\/strong>n\u0131 ele alaca\u011f\u0131z. Bu API Komutlar\u0131na vCenter CLI&#8217;dan eri\u015filebilir.<\/p>\n<p><span>Yak\u0131n zamanda laboratuvar ana bilgisayarlar\u0131m\u0131 h\u0131zl\u0131 bir \u015fekilde almak zorunda kald\u0131\u011f\u0131m ve vCenter&#8217;\u0131n vSphere 7.0U3k&#8217;ye y\u00fckseltilmesiyle ilgili k\u00fc\u00e7\u00fck bir sorun hakk\u0131nda yazm\u0131\u015ft\u0131m, neyse ki vSphere Ya\u015fam D\u00f6ng\u00fcs\u00fc Y\u00f6neticisi beni kurtard\u0131. Bu s\u00fcre\u00e7 s\u0131ras\u0131nda vCenter&#8217;da, SSH&#8217;yi vCenter&#8217;a y\u00fckledikten sonra do\u011frudan CLI&#8217;den yapabilece\u011finiz \u00e7ok say\u0131da API \u00e7a\u011fr\u0131s\u0131 oldu\u011funu ke\u015ffettim.<\/span><\/p>\n<p><span>vCenter&#8217;a SSH uygulad\u0131\u011f\u0131n\u0131zda sizden sunucusal yard\u0131m komutlar\u0131 istenir:<\/span><\/p>\n<ul>\n<li><span>API&#8217;leri listele: \u201cyard\u0131m API listesi\u201d<\/span><\/li>\n<li><span>Liste Eklentileri: \u201chelp pi list\u201d<\/span><\/li>\n<li><span>BASH&#8217;i ba\u015flat\u0131n: \u201ckabuk\u201d<\/span><\/li>\n<\/ul>\n<p><span>Genel olarak, bunu hemen yap\u0131p &#8220;kabuk&#8221; yaz\u0131p elimdeki g\u00f6reve ge\u00e7iyorum.<\/span><\/p>\n<p><span>Son felaketim s\u0131ras\u0131nda &#8220;API&#8217;leri&#8221; ara\u015ft\u0131rmaya karar verdim. G\u00f6rd\u00fc\u011f\u00fcn\u00fcz gibi, y\u00fckseltme s\u0131ras\u0131nda mucizevi bir \u015fekilde kendi kendine d\u00fczelen garip bir sorun nedeniyle vCenter&#8217;da belirli de\u011fi\u015fiklikler yapamad\u0131m. Sorunu nas\u0131l a\u015ft\u0131\u011f\u0131m\u0131 ayr\u0131 bir g\u00f6nderide yazaca\u011f\u0131m. \u015eimdilik, vCenter&#8217;a giri\u015f yapt\u0131ktan sonra metin men\u00fcs\u00fcndeki &#8220;API&#8217;lere&#8221; odaklanal\u0131m.<\/span><\/p>\n<p><span>Devam etmeden \u00f6nce, hem vCenter 7 hem de vCenter 8 i\u00e7in t\u00fcm API komutlar\u0131 hakk\u0131ndaki a\u00e7\u0131klamalara ba\u015fvurmak istiyorum. Daha fazla bilgi edinmek i\u00e7in a\u015fa\u011f\u0131daki URL&#8217;lere t\u0131klayarak vCenter s\u00fcr\u00fcm\u00fcn\u00fcze ula\u015fabilirsiniz.<\/span><\/p>\n<p><a href=\"https:\/\/docs.vmware.com\/en\/VMware-vSphere\/7.0\/com.vmware.vsphere.vcenter.configuration.doc\/GUID-CCC172CB-7CCB-41E4-B46A-0B5876E24EF5.html\" rel=\"nofollow noopener\" target=\"_blank\"><span>vCenter 7.0 API Komutlar\u0131<\/span><\/a><\/p>\n<p><a href=\"https:\/\/docs.vmware.com\/en\/VMware-vSphere\/7.0\/com.vmware.vsphere.vcenter.configuration.doc\/GUID-CCC172CB-7CCB-41E4-B46A-0B5876E24EF5.html\" rel=\"nofollow noopener\" target=\"_blank\"><span>https:\/\/docs.vmware.com\/tr\/VMware-vSphere\/7.0\/com.vmware.vsphere.vcenter.configuration.doc\/GUID-CCC172CB-7CCB-41E4-B46A-0B5876E24EF5.html<\/span><\/a><\/p>\n<p><a href=\"https:\/\/docs.vmware.com\/en\/VMware-vSphere\/8.0\/vsphere-vcenter-configuration\/GUID-CCC172CB-7CCB-41E4-B46A-0B5876E24EF5.html\" rel=\"nofollow noopener\" target=\"_blank\"><span>vCenter 8.0 API Komutlar\u0131<\/span><\/a><\/p>\n<p><a href=\"https:\/\/docs.vmware.com\/en\/VMware-vSphere\/8.0\/vsphere-vcenter-configuration\/GUID-CCC172CB-7CCB-41E4-B46A-0B5876E24EF5.html\" rel=\"nofollow noopener\" target=\"_blank\"><span>https:\/\/docs.vmware.com\/tr\/VMware-vSphere\/8.0\/vsphere-vcenter-yap\u0131land\u0131rmas\u0131\/GUID-CCC172CB-7CCB-41E4-B46A-0B5876E24EF5.html<\/span><\/a><\/p>\n<p><span>Hadi konuya geri d\u00f6nelim. SSH kullanarak vCenter&#8217;da oturum a\u00e7t\u0131ktan sonra a\u015fa\u011f\u0131daki komutu yaz\u0131n:<\/span><\/p>\n<div class=\"highlight\">\n<pre tabindex=\"0\"><code class=\"language-plaintext hljs\" data-lang=\"plaintext\">help api list\r\n<\/code><\/pre>\n<\/div>\n<p><span>API komutlar\u0131n\u0131n tablo bi\u00e7iminde \u00e7ok uzun bir listesini g\u00f6receksiniz. A\u015fa\u011f\u0131da tablonun \u00e7ok k\u0131salt\u0131lm\u0131\u015f bir versiyonunu ekledim:<\/span><\/p>\n<table>\n<thead>\n<tr>\n<th><span>API Komutu<\/span><\/th>\n<th><span>Tan\u0131m<\/span><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td data-header=\"API Command\"><span>com.vmware.appliance.health.applmgmt.get<\/span><\/td>\n<td data-header=\"Description\"><span>Applmgmt servisinin sa\u011fl\u0131\u011f\u0131n\u0131 al\u0131n.<\/span><\/td>\n<\/tr>\n<tr>\n<td data-header=\"API Command\"><span>com.vmware.appliance.health.databasestorage.get<\/span><\/td>\n<td data-header=\"Description\"><span>Veritaban\u0131 depolamas\u0131n\u0131n durumunu \u00f6\u011frenin.<\/span><\/td>\n<\/tr>\n<tr>\n<td data-header=\"API Command\"><span>com.vmware.appliance.health.load.get<\/span><\/td>\n<td data-header=\"Description\"><span>CPU y\u00fck durumunu al\u0131n.<\/span><\/td>\n<\/tr>\n<tr>\n<td data-header=\"API Command\"><span>.<\/span><\/td>\n<td data-header=\"Description\"><span>.<\/span><\/td>\n<\/tr>\n<tr>\n<td data-header=\"API Command\"><span>.<\/span><\/td>\n<td data-header=\"Description\"><span>.<\/span><\/td>\n<\/tr>\n<tr>\n<td data-header=\"API Command\"><span>com.vmware.appliance.version1.system.version.get<\/span><\/td>\n<td data-header=\"Description\"><span>Cihaz\u0131n versiyonunu edinin.<\/span><\/td>\n<\/tr>\n<tr>\n<td data-header=\"API Command\"><span>com.vmware.appliance.version1.timesync.get<\/span><\/td>\n<td data-header=\"Description\"><span>Zaman senkronizasyonu yap\u0131land\u0131rmas\u0131n\u0131 al\u0131n.<\/span><\/td>\n<\/tr>\n<tr>\n<td data-header=\"API Command\"><span>com.vmware.appliance.version1.timesync.set<\/span><\/td>\n<td data-header=\"Description\"><span>Zaman senkronizasyon yap\u0131land\u0131rmas\u0131n\u0131 ayarlay\u0131n.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span>\u015eu ana kadar muhtemelen \u015funu d\u00fc\u015f\u00fcn\u00fcyorsun, ne olmu\u015f yani? Bu bilgiyi avantaj\u0131ma nas\u0131l kullan\u0131r\u0131m? Harika soru! Komut sat\u0131r\u0131na a\u015fa\u011f\u0131daki komutu girin:<\/span><\/p>\n<div class=\"highlight\">\n<pre tabindex=\"0\"><code class=\"language-plaintext hljs\" data-lang=\"plaintext\">api com.vmware.appliance.version1.networking.dns.servers.get\r\n<\/code><\/pre>\n<\/div>\n<p><span>A\u015fa\u011f\u0131daki \u00e7\u0131kt\u0131ya benzer bir \u015fey g\u00f6rmelisiniz:<\/span><\/p>\n<div class=\"highlight\">\n<pre tabindex=\"0\"><code class=\"language-plaintext hljs\" data-lang=\"plaintext\">Config: \r\n   Mode: static\r\n   Servers: 192.168.124.31 192.168.124.32\r\n<\/code><\/pre>\n<\/div>\n<p><span>Bu API komutu, vCenter cihaz\u0131 i\u00e7in yap\u0131land\u0131rd\u0131\u011f\u0131n\u0131z DNS sunucular\u0131n\u0131 al\u0131r veya al\u0131r (\u00e7a\u011fr\u0131n\u0131n sonunda &#8220;get&#8221; terimine dikkat edin).<\/span><\/p>\n<p><span>Ba\u015fka bir API \u00e7a\u011fr\u0131s\u0131 deneyin.<\/span><br \/>\n<span>Uygulamada \u00e7al\u0131\u015fan kodun s\u00fcr\u00fcm\u00fcn\u00fc alal\u0131m. Komut sat\u0131r\u0131na a\u015fa\u011f\u0131daki komutu girin:<\/span><\/p>\n<div class=\"highlight\">\n<pre tabindex=\"0\"><code class=\"language-plaintext hljs\" data-lang=\"plaintext\">api com.vmware.appliance.version1.system.version.get\r\n<\/code><\/pre>\n<\/div>\n<p><span>\u0130\u015fte \u00e7\u0131kt\u0131m \u015f\u00f6yle g\u00f6r\u00fcn\u00fcyor:<\/span><\/p>\n<div class=\"highlight\">\n<pre tabindex=\"0\"><code class=\"language-plaintext hljs\" data-lang=\"plaintext\">Version:\r\n   Version: 7.0.3.01200\r\n   Product: VMware vCenter Server\r\n   Build: 20990077\r\n   Type: vCenter Server with an embedded Platform Services Controller\r\n   Summary: Patch for VMware vCenter Server 7.0\r\n   Releasedate: December 22, 2022\r\n   Installtime: 2023-02-22T00:09:11.184Z\r\n<\/code><\/pre>\n<\/div>\n<p><span>7.0U3j \u00e7al\u0131\u015ft\u0131rd\u0131\u011f\u0131m\u0131 g\u00f6rebilirsiniz. Bu g\u00f6nderiyi yazd\u0131\u011f\u0131m s\u0131rada vCenter i\u00e7in 7.0U3k g\u00fcncellemesi yoktu, sadece ESXi vard\u0131. API \u00e7a\u011fr\u0131s\u0131 taraf\u0131ndan d\u00f6nd\u00fcr\u00fclen gizemli bilgilerden bu s\u00fcr\u00fcm numaras\u0131n\u0131 nas\u0131l elde ettim? vCenter derleme numaras\u0131n\u0131 s\u00fcr\u00fcm numaras\u0131na e\u015flemek i\u00e7in buraya gidin:<\/span><\/p>\n<p><span>VMware vCenter Server&#8217;\u0131n yap\u0131 numaralar\u0131 ve s\u00fcr\u00fcmleri (2143838)<\/span><\/p>\n<p><span>Ayn\u0131 \u015feyi ESXi i\u00e7in anlamak i\u00e7in bu ba\u011flant\u0131y\u0131 kullanabilirsiniz:<\/span><\/p>\n<p><span>VMware ESXi\/ESX&#8217;in derleme numaralar\u0131 ve s\u00fcr\u00fcmleri (2143832)<\/span><\/p>\n<p><span>Son bir ba\u011flant\u0131. \u0130\u015fte birka\u00e7 ba\u015fka VMware \u00fcr\u00fcn\u00fc i\u00e7in bir ba\u011flant\u0131:<\/span><\/p>\n<p><span>VMware \u00fcr\u00fcnlerinin yap\u0131 numaralar\u0131n\u0131 ve s\u00fcr\u00fcmlerini ili\u015fkilendirme (1014508)<\/span><\/p>\n<p><span>VMware \u00fcr\u00fcnlerinin yap\u0131 numaralar\u0131 ve s\u00fcr\u00fcmleri konusunda konudan uzakla\u015ft\u0131\u011f\u0131m i\u00e7in \u00f6z\u00fcr dilerim.<\/span><\/p>\n<p><span>Bilgi almak veya &#8220;almak&#8221; i\u00e7in yap\u0131lan API \u00e7a\u011fr\u0131lar\u0131 g\u00fczel. Peki ya bir ayar\u0131 de\u011fi\u015ftirmek istiyorsan\u0131z? Sonunda &#8220;set&#8221; kelimesi olan bir \u00e7a\u011fr\u0131 bulmak olduk\u00e7a basit. Hadi gidip DNS sunucusu ayarlar\u0131n\u0131 de\u011fi\u015ftirelim veya ayarlayal\u0131m. vCenter i\u00e7in.<\/span><\/p>\n<p><span>\u00c7a\u011fr\u0131 listesine bak\u0131n ve \u015fu API \u00e7a\u011fr\u0131s\u0131n\u0131 bulun:<\/span><\/p>\n<div class=\"highlight\">\n<pre tabindex=\"0\"><code class=\"language-plaintext hljs\" data-lang=\"plaintext\">com.vmware.appliance.version1.networking.dns.servers.set\r\n<\/code><\/pre>\n<\/div>\n<p><span>API \u00e7a\u011fr\u0131lar\u0131n\u0131 &#8220;ayarlamak&#8221; i\u00e7in baz\u0131 bilgiler sa\u011flaman\u0131z gerekecektir. Hangi bilgilerin gerekli oldu\u011funu anlamak i\u00e7in a\u015fa\u011f\u0131daki komutu \u00e7al\u0131\u015ft\u0131r\u0131n.<\/span><\/p>\n<div class=\"highlight\">\n<pre tabindex=\"0\"><code class=\"language-plaintext hljs\" data-lang=\"plaintext\">help api com.vmware.appliance.version1.networking.dns.servers.set\r\n<\/code><\/pre>\n<\/div>\n<p><span>\u00c7a\u011fr\u0131n\u0131n \u00e7\u0131kt\u0131s\u0131 \u015fu \u015fekilde g\u00f6r\u00fcnecektir:<\/span><\/p>\n<div class=\"highlight\">\n<pre tabindex=\"0\"><code class=\"language-plaintext hljs\" data-lang=\"plaintext\">Usage:\r\n         com.vmware.appliance.version1.networking.dns.servers.set\r\n         [--help\/-h] --mode ENUM --servers STR\r\nDescription:\r\n         Set the DNS server configuration. If you set the mode\r\n         argument to \"DHCP\", a DHCP refresh is forced.\r\nInput Arguments:\r\n --mode ENUM\r\n         Define how to determine the DNS servers. Leave the servers\r\n         argument empty if the mode argument is \"DHCP\". Set the\r\n         servers argument to a comma-separated list of DNS servers if\r\n         the mode argument is \"static\". The DNS server are assigned\r\n         from the specified list. 'static': ' DNS address is static.\r\n         ', 'dhcp': ' DNS address is automatically assigned by a DHCP\r\n         server. '\r\n --servers STR\r\n         List of the currently used DNS servers.\r\n<\/code><\/pre>\n<\/div>\n<p><span>DNS sunucusu ayar\u0131m\u0131 ald\u0131\u011f\u0131mda bu bilgiler d\u00f6nd\u00fcr\u00fcld\u00fc\u011f\u00fcnden DNS <a href=\"https:\/\/sunucucozumleri.com\/blog\/frontpage\/\">sunucu<\/a> ayar\u0131m\u0131n statik oldu\u011funu biliyorum. Bu, ENUM arg\u00fcman\u0131 i\u00e7in &#8216;statik&#8217; kullanaca\u011f\u0131m ve kullanmak istedi\u011fim sunucular\u0131n listesinin \u201c192.168.124.31\u201d olaca\u011f\u0131 anlam\u0131na geliyor.<\/span><\/p>\n<p><span>Komut \u015fu \u015fekilde g\u00f6r\u00fcn\u00fcyor:<\/span><\/p>\n<div class=\"highlight\">\n<pre tabindex=\"0\"><code class=\"language-plaintext hljs\" data-lang=\"plaintext\">api com.vmware.appliance.version1.networking.dns.servers.set --mode static --servers \"192.168.124.31\"\r\n<\/code><\/pre>\n<\/div>\n<p><span>E\u011fer arg\u00fcmanlardan herhangi birini yanl\u0131\u015f yazm\u0131\u015f olsayd\u0131m veya arg\u00fcmanlar\u0131 yanl\u0131\u015f bi\u00e7imlendirmi\u015f olsayd\u0131m bir hata al\u0131rd\u0131m. Yeni ayar\u0131 onaylayal\u0131m. Kar\u015f\u0131la\u015ft\u0131rma i\u00e7in bu yaz\u0131n\u0131n ba\u015f\u0131nda verdi\u011fim DNS get komutunu \u00e7al\u0131\u015ft\u0131r\u0131n. Art\u0131k bir DNS sunucusunun eksik oldu\u011funu g\u00f6receksiniz.<\/span><\/p>\n<div class=\"highlight\">\n<pre tabindex=\"0\"><code class=\"language-plaintext hljs\" data-lang=\"plaintext\">Config:\r\n   Mode: static\r\n   Servers: 192.168.124.31\r\n<\/code><\/pre>\n<\/div>\n<p><span>\u0130kinci DNS sunucusunu eklemek istersem ADD komutunu kullanmama gerek yok. A\u015fa\u011f\u0131daki komutu \u00e7al\u0131\u015ft\u0131rabilirim:<\/span><\/p>\n<div class=\"highlight\">\n<pre tabindex=\"0\"><code class=\"language-plaintext hljs\" data-lang=\"plaintext\">api com.vmware.appliance.version1.networking.dns.servers.add --server \"192.168.124.32\"\r\n<\/code><\/pre>\n<\/div>\n<p><span>\u0130\u015fte! Ba\u015flad\u0131\u011f\u0131m yere geri d\u00f6nd\u00fcm. Bunun do\u011fru oldu\u011funu onaylamak i\u00e7in DNS Sunucular\u0131 get komutunu \u00e7al\u0131\u015ft\u0131rabilirim.<\/span><\/p>\n<p><span>Bu makalenin t\u00fcm amac\u0131, size API&#8217;lerin nas\u0131l kullan\u0131laca\u011f\u0131n\u0131 ve programc\u0131 olmayan\/DevOps olmayan bir ki\u015fi olarak bunlar\u0131 vCenter&#8217;da yap\u0131land\u0131rma de\u011fi\u015fiklikleri almak ve ayarlamak i\u00e7in nas\u0131l kullanabilece\u011finizi \u00e7ok temel bir d\u00fczeyde tan\u0131tmakt\u0131. Bu, gizli bir dosyada veya vCenter GUI&#8217;si sizinle i\u015fbirli\u011fi yapmad\u0131\u011f\u0131nda DNS sunucusunu nas\u0131l de\u011fi\u015ftirece\u011finizi anlamaya \u00e7al\u0131\u015fmaktan da daha kolayd\u0131r.<\/span><\/p>\n<p><span>Umar\u0131m bu yaz\u0131 size yard\u0131mc\u0131 olmu\u015ftur.<\/span><\/p>\n<p><span>E\u011fer benim eksik oldu\u011funu d\u00fc\u015f\u00fcnd\u00fc\u011f\u00fcn\u00fcz ve eklenmesi gerekti\u011fini d\u00fc\u015f\u00fcnd\u00fc\u011f\u00fcn\u00fcz bir \u015fey varsa\u00a0<\/span><span>l\u00fctfen bana bildirin.<\/span><\/p>\n<p><span>Okudu\u011funuz i\u00e7in te\u015fekk\u00fcrler!<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bu yaz\u0131da vCenter API Komutlar\u0131n\u0131 ele alaca\u011f\u0131z. Bu API Komutlar\u0131na vCenter CLI&#8217;dan eri\u015filebilir. Yak\u0131n zamanda laboratuvar ana bilgisayarlar\u0131m\u0131 h\u0131zl\u0131 bir \u015fekilde almak zorunda kald\u0131\u011f\u0131m ve vCenter&#8217;\u0131n vSphere 7.0U3k&#8217;ye y\u00fckseltilmesiyle ilgili k\u00fc\u00e7\u00fck bir sorun hakk\u0131nda yazm\u0131\u015ft\u0131m, neyse ki vSphere Ya\u015fam D\u00f6ng\u00fcs\u00fc Y\u00f6neticisi beni kurtard\u0131. Bu s\u00fcre\u00e7 s\u0131ras\u0131nda vCenter&#8217;da, SSH&#8217;yi vCenter&#8217;a y\u00fckledikten sonra do\u011frudan CLI&#8217;den yapabilece\u011finiz \u00e7ok &hellip;<\/p>\n","protected":false},"author":1,"featured_media":8176,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[15],"tags":[],"class_list":["post-8175","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esxi"],"acf":[],"_links":{"self":[{"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/posts\/8175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/comments?post=8175"}],"version-history":[{"count":0,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/posts\/8175\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/media\/8176"}],"wp:attachment":[{"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/media?parent=8175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/categories?post=8175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sunucucozumleri.com\/blog\/wp-json\/wp\/v2\/tags?post=8175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}