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.
 
 
 
 
pyceo/ceo_common/interfaces/IVHostManager.py

36 lines
975 B

from typing import List, Dict
from zope.interface import Interface
class IVHostManager(Interface):
"""Performs operations on the CSC Cloud."""
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 delete_all_vhosts_for_user(username: str):
"""
Delete all vhost records for the given user.
"""
def get_num_vhosts(username: str) -> int:
"""
Get the number of vhost records for the given user.
"""
def get_vhosts(username: str) -> List[Dict]:
"""
Get the vhost records for the given user. Each record has the form
{
"domain": "app.username.m.csclub.cloud",
"ip_address": "172.19.134.12"
}
"""