{"id":64,"date":"2019-12-23T15:56:15","date_gmt":"2019-12-23T14:56:15","guid":{"rendered":"http:\/\/thomas-kopton.de\/vblog\/?p=64"},"modified":"2019-12-23T15:56:36","modified_gmt":"2019-12-23T14:56:36","slug":"quick-tip-vrops-rest-api-requests-using-regex-expressions","status":"publish","type":"post","link":"https:\/\/thomas-kopton.de\/vblog\/?p=64","title":{"rendered":"Quick Tip &#8211; vROps REST API requests using RegEx expressions"},"content":{"rendered":"<p>The vRealize Operations REST API allows using RegEx expressions in various GET methods.<\/p>\n<p>Sometimes it is not clear how to use the expressions. Here a very simple example of using RegEx to retrieve vROps Virtual Machine objects, which have VM names starting with certain strings.<\/p>\n<p>Encoded URL &#8211; example:<\/p>\n<pre>https:\/\/vrops-test.comp01.local\/suite-api\/api\/resources?resourceKind=VirtualMachine&amp;adapterKind=VMWARE&amp;regex=s030v.*%7Cs030e.*%7CS030E.*<\/pre>\n<p>Example in Postman (of course, you need to replace the toke with a valid one):<\/p>\n<pre>https:\/\/vrops-test.comp01.local\/suite-api\/api\/resources resourceKind=VirtualMachine&amp;adapterKind=VMWARE&amp;regex=s030v.*|s030e.*|S030E.*|S030V.*<\/pre>\n<p><a href=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/12\/regExpost-01.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-232\" src=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/12\/regExpost-01.png\" alt=\"\" width=\"3220\" height=\"2074\" srcset=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/12\/regExpost-01.png 3220w, https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/12\/regExpost-01-300x193.png 300w, https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/12\/regExpost-01-1024x660.png 1024w, https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/12\/regExpost-01-768x495.png 768w, https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/12\/regExpost-01-1536x989.png 1536w, https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/12\/regExpost-01-2048x1319.png 2048w\" sizes=\"auto, (max-width: 3220px) 100vw, 3220px\" \/><\/a><\/p>\n<p>And in Curl (of course, you need to replace the toke with a valid one):<\/p>\n<pre>curl -X GET \\\n 'https:\/\/vrops-test.comp01.local\/suite-api\/api\/resources?resourceKind=VirtualMachine&amp;adapterKind=VMWARE&amp;regex=s030v.*%7Cs030e.*%7CS030E.*%7CS030V.*' \\\n -H 'accept: application\/json' \\\n -H 'authorization: Basic xxxxxxxxxx \\\n -H 'cache-control: no-cache' \\\n -H 'content-type: application\/json' \\\n -H 'postman-token: yyyyyyyyyyyy'<\/pre>\n<p>it works perfectly and it is case sensitive.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The vRealize Operations REST API allows using RegEx expressions in various GET methods. Sometimes it is not clear how to use the expressions. Here a very simple example of using RegEx to retrieve vROps Virtual Machine objects, which have VM names starting with certain strings. Encoded URL &#8211; example: https:\/\/vrops-test.comp01.local\/suite-api\/api\/resources?resourceKind=VirtualMachine&amp;adapterKind=VMWARE&amp;regex=s030v.*%7Cs030e.*%7CS030E.* Example in Postman (of course, &#8230;<\/p>\n","protected":false},"author":1,"featured_media":232,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[6,3],"class_list":["post-64","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vrops","tag-rest","tag-vrops"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Quick Tip - vROps REST API requests using RegEx expressions - TOMsOps<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thomas-kopton.de\/vblog\/?p=64\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Quick Tip - vROps REST API requests using RegEx expressions - TOMsOps\" \/>\n<meta property=\"og:description\" content=\"The vRealize Operations REST API allows using RegEx expressions in various GET methods. Sometimes it is not clear how to use the expressions. Here a very simple example of using RegEx to retrieve vROps Virtual Machine objects, which have VM names starting with certain strings. Encoded URL &#8211; example: https:\/\/vrops-test.comp01.local\/suite-api\/api\/resources?resourceKind=VirtualMachine&amp;adapterKind=VMWARE&amp;regex=s030v.*%7Cs030e.*%7CS030E.* Example in Postman (of course, ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thomas-kopton.de\/vblog\/?p=64\" \/>\n<meta property=\"og:site_name\" content=\"TOMsOps\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-23T14:56:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-12-23T14:56:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/12\/regExpost-01.png\" \/>\n\t<meta property=\"og:image:width\" content=\"3220\" \/>\n\t<meta property=\"og:image:height\" content=\"2074\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Thomas Kopton\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thomas Kopton\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/thomas-kopton.de\/vblog\/?p=64#article\",\"isPartOf\":{\"@id\":\"https:\/\/thomas-kopton.de\/vblog\/?p=64\"},\"author\":{\"name\":\"Thomas Kopton\",\"@id\":\"https:\/\/thomas-kopton.de\/vblog\/#\/schema\/person\/892d6b96c66b1dd4b75c6e32fdbfea82\"},\"headline\":\"Quick Tip &#8211; vROps REST API requests using RegEx expressions\",\"datePublished\":\"2019-12-23T14:56:15+00:00\",\"dateModified\":\"2019-12-23T14:56:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/thomas-kopton.de\/vblog\/?p=64\"},\"wordCount\":97,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/thomas-kopton.de\/vblog\/?p=64#primaryimage\"},\"thumbnailUrl\":\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/12\/regExpost-01.png\",\"keywords\":[\"REST\",\"vROps\"],\"articleSection\":[\"vROps\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/thomas-kopton.de\/vblog\/?p=64#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/thomas-kopton.de\/vblog\/?p=64\",\"url\":\"https:\/\/thomas-kopton.de\/vblog\/?p=64\",\"name\":\"Quick Tip - vROps REST API requests using RegEx expressions - TOMsOps\",\"isPartOf\":{\"@id\":\"https:\/\/thomas-kopton.de\/vblog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/thomas-kopton.de\/vblog\/?p=64#primaryimage\"},\"image\":{\"@id\":\"https:\/\/thomas-kopton.de\/vblog\/?p=64#primaryimage\"},\"thumbnailUrl\":\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/12\/regExpost-01.png\",\"datePublished\":\"2019-12-23T14:56:15+00:00\",\"dateModified\":\"2019-12-23T14:56:36+00:00\",\"author\":{\"@id\":\"https:\/\/thomas-kopton.de\/vblog\/#\/schema\/person\/892d6b96c66b1dd4b75c6e32fdbfea82\"},\"breadcrumb\":{\"@id\":\"https:\/\/thomas-kopton.de\/vblog\/?p=64#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/thomas-kopton.de\/vblog\/?p=64\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/thomas-kopton.de\/vblog\/?p=64#primaryimage\",\"url\":\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/12\/regExpost-01.png\",\"contentUrl\":\"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/12\/regExpost-01.png\",\"width\":3220,\"height\":2074},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/thomas-kopton.de\/vblog\/?p=64#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/thomas-kopton.de\/vblog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Quick Tip &#8211; vROps REST API requests using RegEx expressions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/thomas-kopton.de\/vblog\/#website\",\"url\":\"https:\/\/thomas-kopton.de\/vblog\/\",\"name\":\"TOMsOps\",\"description\":\"Just another VMware Cloud Management Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/thomas-kopton.de\/vblog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/thomas-kopton.de\/vblog\/#\/schema\/person\/892d6b96c66b1dd4b75c6e32fdbfea82\",\"name\":\"Thomas Kopton\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/thomas-kopton.de\/vblog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e746aafbd3733172ceb4d600ba1feda61bc87cd3b70f5a9dfb581907cc7973b1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e746aafbd3733172ceb4d600ba1feda61bc87cd3b70f5a9dfb581907cc7973b1?s=96&d=mm&r=g\",\"caption\":\"Thomas Kopton\"},\"url\":\"https:\/\/thomas-kopton.de\/vblog\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Quick Tip - vROps REST API requests using RegEx expressions - TOMsOps","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/thomas-kopton.de\/vblog\/?p=64","og_locale":"en_US","og_type":"article","og_title":"Quick Tip - vROps REST API requests using RegEx expressions - TOMsOps","og_description":"The vRealize Operations REST API allows using RegEx expressions in various GET methods. Sometimes it is not clear how to use the expressions. Here a very simple example of using RegEx to retrieve vROps Virtual Machine objects, which have VM names starting with certain strings. Encoded URL &#8211; example: https:\/\/vrops-test.comp01.local\/suite-api\/api\/resources?resourceKind=VirtualMachine&amp;adapterKind=VMWARE&amp;regex=s030v.*%7Cs030e.*%7CS030E.* Example in Postman (of course, ...","og_url":"https:\/\/thomas-kopton.de\/vblog\/?p=64","og_site_name":"TOMsOps","article_published_time":"2019-12-23T14:56:15+00:00","article_modified_time":"2019-12-23T14:56:36+00:00","og_image":[{"width":3220,"height":2074,"url":"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/12\/regExpost-01.png","type":"image\/png"}],"author":"Thomas Kopton","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Thomas Kopton","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thomas-kopton.de\/vblog\/?p=64#article","isPartOf":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=64"},"author":{"name":"Thomas Kopton","@id":"https:\/\/thomas-kopton.de\/vblog\/#\/schema\/person\/892d6b96c66b1dd4b75c6e32fdbfea82"},"headline":"Quick Tip &#8211; vROps REST API requests using RegEx expressions","datePublished":"2019-12-23T14:56:15+00:00","dateModified":"2019-12-23T14:56:36+00:00","mainEntityOfPage":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=64"},"wordCount":97,"commentCount":0,"image":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=64#primaryimage"},"thumbnailUrl":"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/12\/regExpost-01.png","keywords":["REST","vROps"],"articleSection":["vROps"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thomas-kopton.de\/vblog\/?p=64#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thomas-kopton.de\/vblog\/?p=64","url":"https:\/\/thomas-kopton.de\/vblog\/?p=64","name":"Quick Tip - vROps REST API requests using RegEx expressions - TOMsOps","isPartOf":{"@id":"https:\/\/thomas-kopton.de\/vblog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=64#primaryimage"},"image":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=64#primaryimage"},"thumbnailUrl":"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/12\/regExpost-01.png","datePublished":"2019-12-23T14:56:15+00:00","dateModified":"2019-12-23T14:56:36+00:00","author":{"@id":"https:\/\/thomas-kopton.de\/vblog\/#\/schema\/person\/892d6b96c66b1dd4b75c6e32fdbfea82"},"breadcrumb":{"@id":"https:\/\/thomas-kopton.de\/vblog\/?p=64#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thomas-kopton.de\/vblog\/?p=64"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/thomas-kopton.de\/vblog\/?p=64#primaryimage","url":"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/12\/regExpost-01.png","contentUrl":"https:\/\/thomas-kopton.de\/vblog\/wp-content\/uploads\/2019\/12\/regExpost-01.png","width":3220,"height":2074},{"@type":"BreadcrumbList","@id":"https:\/\/thomas-kopton.de\/vblog\/?p=64#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thomas-kopton.de\/vblog"},{"@type":"ListItem","position":2,"name":"Quick Tip &#8211; vROps REST API requests using RegEx expressions"}]},{"@type":"WebSite","@id":"https:\/\/thomas-kopton.de\/vblog\/#website","url":"https:\/\/thomas-kopton.de\/vblog\/","name":"TOMsOps","description":"Just another VMware Cloud Management Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thomas-kopton.de\/vblog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/thomas-kopton.de\/vblog\/#\/schema\/person\/892d6b96c66b1dd4b75c6e32fdbfea82","name":"Thomas Kopton","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/thomas-kopton.de\/vblog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e746aafbd3733172ceb4d600ba1feda61bc87cd3b70f5a9dfb581907cc7973b1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e746aafbd3733172ceb4d600ba1feda61bc87cd3b70f5a9dfb581907cc7973b1?s=96&d=mm&r=g","caption":"Thomas Kopton"},"url":"https:\/\/thomas-kopton.de\/vblog\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/posts\/64","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=64"}],"version-history":[{"count":9,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/posts\/64\/revisions"}],"predecessor-version":[{"id":234,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/posts\/64\/revisions\/234"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=\/wp\/v2\/media\/232"}],"wp:attachment":[{"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=64"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=64"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thomas-kopton.de\/vblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}