threefoldtecharchive / jumpscale9_lib

Apache License 2.0
0 stars 1 forks source link

Jumpscale Coredns SAL #206

Closed arahmanhamdy closed 5 years ago

arahmanhamdy commented 5 years ago

Installation information

Detailed description

We need to have jumpscale clients for coredns to register domains

Suggested specs:

Coredns Client:

template:

etcd = "" #the etcd client instance name to be used

With this in mind I can see an API like this:

class CoreDns:
   def __init__(self, etcd_client):
     self.etcd_clients = etcd_clients

def register_a_records(self, domains, ips):
   """
    write the requires configuration in etcd
   """
   pass

def unregister_reord(self, domain)
   """
  remove configuration from  etcd
   """
    pass

May be we can add more methods for more types of dns records other than A records

zaibon commented 5 years ago

ok regarding the API I had more something like that in mind:

class Domain:

    def __init__(self):
        self.records = []

    def add_records(self, record):
        pass

    def remove_records(self, record):
        pass

class Record:
    def __init__(self, type, target):
        self.type = "A"
        self.target = '...'

class RecordType(Enum):
    A = "A"
zaibon commented 5 years ago

Seems we already have https://github.com/threefoldtech/jumpscale_lib/tree/development_simple/JumpscaleLib/clients/coredns. @andrewayoub please have a look and check if this client provides what we need for the webgateway. If yes then we don't have anything to do

zaibon commented 5 years ago

https://github.com/threefoldtech/jumpscale_lib/pull/209#issuecomment-433708168 there we had a disscision about whether this should be a client or a SAL. turns out this is a SAL. so if we keep the current implementation, we also need to move it into the SAL diretories

BolaNasr commented 5 years ago

PR(development) : https://github.com/threefoldtech/jumpscale_lib/pull/215 PR(development_simple) :https://github.com/threefoldtech/jumpscale_lib/pull/217