Python CSC Electronic Office
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.2 KiB

from typing import Dict, List
from zope.interface import Interface
from .IUser import IUser
class ICloudService(Interface):
"""Performs operations on the CSC Cloud."""
def create_account(user: IUser):
Activate an LDAP account in CloudStack for the given user.
def purge_accounts() -> Dict:
Delete CloudStack accounts which correspond to expired CSC accounts.
A warning message will be emailed to users one week before their
cloud account is deleted.
Another message will be emailed to the users after their cloud account
has been deleted.
def create_vhost(username: str, domain: str, ip_address: str):
Create a new vhost record for the given domain and IP address.
def delete_vhost(username: str, domain: str):
Delete the vhost record for the given user and domain.
def get_vhosts(username: str) -> List[Dict]:
Get the vhost records for the given user. Each record has the form
"domain": "",
"ip_address": ""