Skip to content

Commit 78730d8

Browse files
Add SAP licence support to the licensing client
The licensing server now issues standard ('v2') and SAP ('v2-sap') licences, and splits the appliance usage counters per edition under `standard_licence_stats` and `sap_licence_stats` instead of one flat set. Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
1 parent feb881d commit 78730d8

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

‎coriolisclient/constants.py‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,46 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
LICENCE_VERSION_V1 = "v1"
17+
LICENCE_VERSION_V2 = "v2"
18+
LICENCE_VERSION_V2_SAP = "v2-sap"
19+
20+
LICENCE_EDITION_STANDARD = "Standard"
21+
LICENCE_EDITION_SAP = "SAP"
22+
23+
LICENCE_TYPE_EDITION_MAP = {
24+
LICENCE_VERSION_V1: LICENCE_EDITION_STANDARD,
25+
LICENCE_VERSION_V2: LICENCE_EDITION_STANDARD,
26+
LICENCE_VERSION_V2_SAP: LICENCE_EDITION_SAP,
27+
}
28+
29+
RESERVATION_TYPE_REPLICA = "replica"
30+
RESERVATION_TYPE_MIGRATION = "migration"
31+
RESERVATION_TYPE_SAP_REPLICA = "sap_replica"
32+
RESERVATION_TYPE_SAP_MIGRATION = "sap_migration"
33+
34+
RESERVATION_TYPE_EDITION_MAP = {
35+
RESERVATION_TYPE_REPLICA: LICENCE_EDITION_STANDARD,
36+
RESERVATION_TYPE_MIGRATION: LICENCE_EDITION_STANDARD,
37+
RESERVATION_TYPE_SAP_REPLICA: LICENCE_EDITION_SAP,
38+
RESERVATION_TYPE_SAP_MIGRATION: LICENCE_EDITION_SAP,
39+
}
40+
41+
LICENCE_STATS_KEY_STANDARD = "standard_licence_stats"
42+
LICENCE_STATS_KEY_SAP = "sap_licence_stats"
43+
44+
LICENCE_STATS_FIELDS = (
45+
"current_performed_migrations",
46+
"current_performed_replicas",
47+
"current_available_migrations",
48+
"current_available_replicas",
49+
"lifetime_performed_migrations",
50+
"lifetime_performed_replicas",
51+
"lifetime_available_migrations",
52+
"lifetime_available_replicas",
53+
)
54+
55+
1656
MIGRATION_STATUS_RUNNING = "RUNNING"
1757
MIGRATION_STATUS_COMPLETED = "COMPLETED"
1858
MIGRATION_STATUS_ERROR = "ERROR"

0 commit comments

Comments
 (0)