Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added mechanism to set human readable name while import cluster flow #890

Merged
merged 5 commits into from
Apr 9, 2018

Conversation

shtripat
Copy link
Member

@shtripat shtripat commented Apr 1, 2018

tendrl-bug-id: #888
Signed-off-by: Shubhendu shtripat@redhat.com

@shtripat shtripat requested a review from a team as a code owner April 1, 2018 17:11
@shtripat
Copy link
Member Author

shtripat commented Apr 1, 2018

THIS IS WIP. YET TO VERIFY WITH ALL THE SCENARIOS.

@shtripat shtripat force-pushed the human-readable-cluster-name branch 2 times, most recently from 97977f1 to b916feb Compare April 2, 2018 17:17
@shtripat
Copy link
Member Author

shtripat commented Apr 2, 2018

Verified the changes with Tendrl/monitoring-integration#394 with below scenarios

  • Import cluster without passing Cluster.short_name field
  • Import cluster with Cluster.short_name field
  • Un-manage a cluster imported with short_name

Works as expected. API module doesnt need any changes for this and UI need changes to pass Cluster.short_name (optional) if human readable name to be used for cluster. Also UI should display the short_name if available for a cluster.

@gnehapk ^^^

Sample API payload for importing a cluster with short_name looks as below

POST /clusters/:integration_id/import

{"Cluster.volume_profiling_flag": "leave-as-is", "Cluster.short_name": "mycluster_123"}

tendrl-bug-id: Tendrl#888
Signed-off-by: Shubhendu <shtripat@redhat.com>
@shtripat shtripat force-pushed the human-readable-cluster-name branch from b916feb to 0db187f Compare April 2, 2018 17:38
_cluster = NS.tendrl.objects.Cluster(
integration_id=entry.key.split('/')[-1]
).load()
if _cluster.short_name and short_name and \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

covert to lower case and check? remove the leading space if any as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

while True:
if loop_count >= wait_count:
logger.log(
"info",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the log level is info? its a failure scenario right?

Copy link
Member Author

@shtripat shtripat Apr 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a job update and yes we can set the severity anything other than notice. will change as error

tendrl-bug-id: Tendrl#888
Signed-off-by: Shubhendu <shtripat@redhat.com>
@shtripat shtripat force-pushed the human-readable-cluster-name branch from 62d6382 to 5d9ad65 Compare April 5, 2018 14:12
@@ -13,6 +14,28 @@ def __init__(self, *args, **kwargs):
def run(self):
if "Node[]" not in self.parameters:
integration_id = self.parameters['TendrlContext.integration_id']
short_name = self.parameters.get('Cluster.short_name', None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add check for max 64 characters.

"type": "monitoring"
}
Job(
job_id=_job_id,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add parent job id

@r0h4n r0h4n merged commit 6a88fbb into Tendrl:master Apr 9, 2018
@r0h4n r0h4n added this to the Milestone 5 (2018) milestone Apr 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants