Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create multiple new objects and referencing one another #25

Open
tvasilopo opened this issue Nov 16, 2020 · 5 comments
Open

Create multiple new objects and referencing one another #25

tvasilopo opened this issue Nov 16, 2020 · 5 comments

Comments

@tvasilopo
Copy link
Contributor

There is a relatively frequent request for an ISP to assign prefixes to new downstream customers. This means that several objects should be created for the new customer simultaneously. An example of a complex arrangement might be a creation containing

  • a person object with "nic-hdl: auto-1”
  • a person object with "nic-hdl: auto-2”
  • a role object with "nic-hdl: auto-3” referencing person auto-1 as "admin-c" and person auto-2 as "tech-c"
  • an inetnum object referencing role "auto-3" as admin-c and tech-c
@fischa
Copy link
Collaborator

fischa commented Jan 28, 2021

Hey @tvasilopo,
I understand the use case but AFAIK you can only reference existing objects - I guess it would break the consistency requirement for the database. So a sequential creation of objects is needed.

What is your question? What are you missing?

@tvasilopo
Copy link
Contributor Author

Hello @fischa ,

Actually you can create multiple objects at the same update and reference one another using the 'AUTO-n' functionality.
There is a reference in here, section 2.5.1
This can be done using the syncupdates but it would be nice to be also done from the tool.
As a matter of fact, in the meantime I deployed it in a fork of this repo and works fine. The object data are inserted in a yaml file that has the following format:

AUTO-1:                                                                                                                               
- person:
- address:
- address:
- address:
- phone:          +30
- nic-hdl:        AUTO-1
- e-mail:
- mnt-by:
- source:         RIPE
 
AUTO-2:
- person:
- address:
- address:
- address:
- phone:          +30
- nic-hdl:        AUTO-2
- e-mail:
- mnt-by:
- source:         RIPE
 
AUTO-3:
- role:
- address:
- address:
- address:
- phone:          +30
- admin-c:        AUTO-1
- tech-c:         AUTO-2
- e-mail:
- remarks:        --------------------------------------
- remarks:        'For complains about abuse, spam etc:'
- abuse-mailbox:
- remarks:        --------------------------------------
- mnt-by:
- nic-hdl:        AUTO-3
- source:         RIPE

[inetnum inserted here]:                        
- inetnum:         
- netname:         
- descr:           
- admin-c:        AUTO-3                         
- tech-c:         AUTO-3                                
- abuse-c:        AUTO-3                                
- status:         ASSIGNED PA                           
- mnt-by:                                      
- mnt-domains:                                                                                                                        
- source:         RIPE                                  
- country:                                            
                                                        
[route prefix inserted here]:                               
- route:           
- descr:           
- descr:           
- origin:         
- mnt-by:                                      
- source:         RIPE

I need to find some time to send a merge request about it.

@fischa
Copy link
Collaborator

fischa commented Jan 28, 2021

Cool! That certainly helps for this kind of changes. But isn't it a matter of templating that? Or what am I missing here?

@tvasilopo
Copy link
Contributor Author

Well, if I understood your question correctly, we 'll have to add the logic that RIPE has deployed in the sync updates regarding the reference between objects that are simultaneously created. Ripeinator tool fails when the above template is provided in the current setup. It will fail in the AUTO-2 object creation as it will not find any person object with 'nic-hdl ' AUTO-1.

@fischa
Copy link
Collaborator

fischa commented Jan 28, 2021

Now I think I got it... From what I get out of the documentation it is only possible to create a single object via the REST API and not a couple of objects like syncupdate or the mail interface.

Does your fork circumvent this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants