expiry
Functionality related to asking the user for IAM binding timeframes.
Expiry
Bases: BaseModel
An Expiry
denotes a timeframe associated with an IAM binding.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Friendly name of the timeframe, such as "Until end of today` |
timestamp |
str
|
ISO8601 timestamp |
Source code in dapla_team_cli/tf/iam_bindings/expiry.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
__hash__()
Implemented to support using GCPRole as a key in a dictionary.
Source code in dapla_team_cli/tf/iam_bindings/expiry.py
27 28 29 |
|
__lt__(__o)
Implement magic lt method to support sorting by name.
Source code in dapla_team_cli/tf/iam_bindings/expiry.py
21 22 23 24 25 |
|
ask_for_expiry()
Prompt the user to select a timeframe constraint to be associated with the IAM bindings.
Returns:
Type | Description |
---|---|
Expiry
|
An user selected |
Source code in dapla_team_cli/tf/iam_bindings/expiry.py
32 33 34 35 36 37 38 39 40 41 42 43 |
|
timestamp_at(end_of='', **offset)
Generate a UTC ISO8601 string relative to the current timestamp.
The resulting timestamp can be further specified by supplying additional Pendulum offsets and end_of
parameters.
Examples:
hours=2
means the timestamp from now + 2 hours
days=4
and end_of="day"
means the timestamp from now + 4 days, at the end of that day (23:59:59)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
end_of |
str
|
Could be any of Pendulum's |
''
|
**offset |
int
|
Could be any of Pendulum's parameters |
{}
|
Returns:
Type | Description |
---|---|
str
|
ISO8601 UTC string |
Source code in dapla_team_cli/tf/iam_bindings/expiry.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|