Skip to content

Commit

Permalink
Added guid support for deployment resource inspection
Browse files Browse the repository at this point in the history
  • Loading branch information
YaswanthKumar-eng committed Sep 6, 2024
1 parent 5ce15f1 commit 1ef30e6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions riocli/deployment/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.
import click
from click_help_colors import HelpColorsCommand
from munch import unmunchify

from munch import unmunchify, munchify
import re
from riocli.config import new_v2_client
from riocli.constants import Colors
from riocli.utils import inspect_with_format
Expand All @@ -38,7 +38,14 @@ def inspect_deployment(
"""
try:
client = new_v2_client()
deployment_obj = client.get_deployment(deployment_name)
deployment_obj = munchify({})

deployment_pattern = r'^dep-[a-z0-9]+$'
if re.fullmatch(deployment_pattern,deployment_name):
list_dep = client.list_deployments(query={'guids': [deployment_name]})
deployment_obj = list_dep[0]
else :
deployment_obj = client.get_deployment(deployment_name)

if not deployment_obj:
click.secho("deployment not found", fg='red')
Expand Down

0 comments on commit 1ef30e6

Please sign in to comment.