Actions :: UUID vs. Tag on command line

William Reade william.reade at canonical.com
Fri Oct 24 18:13:11 UTC 2014


On Fri, Oct 24, 2014 at 8:04 PM, John Weldon <johnweldon4 at gmail.com> wrote:
> Sure, that makes sense.  Right now the Tag encodes a legitimate sequence.
> We should probably just clean up the representation so it doesn't expose the
> internals and just exposes the unit and action sequence number.

Yeah, that works for me. Please don't expose tags in the UI -- as
gustavo says, they're implementation details. The only critically
important property of a tag is that it be a *unique* entity identifier
for API use -- and that requirement is generally at odds with a
pleasant UX.

But, yes, if the user representation happens to have a clean 2-way
mapping with the relevant tags, that makes life easier in some
respects, and I certainly won't complain about that.

Cheers
William

>
>
> --
> John Weldon
>
> On Fri, Oct 24, 2014 at 10:58 AM, Gustavo Niemeyer
> <gustavo.niemeyer at canonical.com> wrote:
>>
>> It was my mistake to call it a hash.. it may be just a random id, in hex
>> form. Alternatively, use a service-specific sequence number so it's better
>> suited to humans. In the latter case, the sequence number must realistically
>> reflect the sequence in which the actions are submitted to units, otherwise
>> it would be confusing.
>>
>> On Fri Oct 24 2014 at 3:51:04 PM John Weldon <johnweldon4 at gmail.com>
>> wrote:
>>>
>>> Thanks Gustavo;
>>>
>>> I think a hash would be good too.  I'll see what I can find in the juju
>>> code base around hash representations of id's, or come up with something.
>>> Any suggestions on how to generate and translate the hash are welcome
>>> too.
>>>
>>> Cheers,
>>>
>>>
>>> --
>>> John Weldon
>>>
>>> On Fri, Oct 24, 2014 at 10:41 AM, Gustavo Niemeyer
>>> <gustavo.niemeyer at canonical.com> wrote:
>>>>
>>>> The "tag" (which might be better named "internal id") looks like an
>>>> implementation detail which doesn't seem right to expose. I'd suggest either
>>>> giving it a proper representation that the user can understand (a sequential
>>>> action number, for example), or use a hash. I'd also not use a UUID, btw,
>>>> but rather just a unique hash.
>>>>
>>>>
>>>>
>>>> On Fri Oct 24 2014 at 2:55:45 PM John Weldon <johnweldon4 at gmail.com>
>>>> wrote:
>>>>>
>>>>> Hi;
>>>>>
>>>>> The current actions spec indicates that the actions command line should
>>>>> return a UUID as the identifier for an action once it's been en-queued using
>>>>> 'juju do <action>'.
>>>>>
>>>>> Is there a compelling reason to use UUID's to identify actions, versus
>>>>> using the string representation of the Tag?
>>>>>
>>>>>
>>>>> A UUID would require a command something like:
>>>>>   juju status action:9e1e5aa0-5b9d-11e4-8ed6-0800200c9a66
>>>>>
>>>>> which maybe we could shorten to:
>>>>>   juju status action:9e1e5aa0
>>>>>
>>>>>
>>>>>
>>>>> I would prefer something like:
>>>>>   juju status action:mysq/0_a_3
>>>>>
>>>>> which would be the string representation of the actions Tag.
>>>>>
>>>>>
>>>>>
>>>>> Is there a compelling reason to use UUID?
>>>>>
>>>>> Cheers,
>>>>>
>>>>> --
>>>>> John Weldon
>>>>> --
>>>>> Juju-dev mailing list
>>>>> Juju-dev at lists.ubuntu.com
>>>>> Modify settings or unsubscribe at:
>>>>> https://lists.ubuntu.com/mailman/listinfo/juju-dev
>>>
>>>
>
>
> --
> Juju-dev mailing list
> Juju-dev at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju-dev
>



More information about the Juju-dev mailing list