Revision 6e8091f9 doc/rapi.rst
b/doc/rapi.rst | ||
---|---|---|
646 | 646 |
It supports the ``dry-run`` argument. |
647 | 647 |
|
648 | 648 |
|
649 |
``/2/networks`` |
|
650 |
+++++++++++++++ |
|
651 |
|
|
652 |
The networks resource. |
|
653 |
|
|
654 |
It supports the following commands: ``GET``, ``POST``. |
|
655 |
|
|
656 |
``GET`` |
|
657 |
~~~~~~~ |
|
658 |
|
|
659 |
Returns a list of all existing networks. |
|
660 |
|
|
661 |
Example:: |
|
662 |
|
|
663 |
[ |
|
664 |
{ |
|
665 |
"name": "network1", |
|
666 |
"uri": "\/2\/networks\/network1" |
|
667 |
}, |
|
668 |
{ |
|
669 |
"name": "network2", |
|
670 |
"uri": "\/2\/networks\/network2" |
|
671 |
} |
|
672 |
] |
|
673 |
|
|
674 |
If the optional bool *bulk* argument is provided and set to a true value |
|
675 |
(i.e ``?bulk=1``), the output contains detailed information about networks |
|
676 |
as a list. |
|
677 |
|
|
678 |
Returned fields: :pyeval:`utils.CommaJoin(sorted(rlib2.NET_FIELDS))`. |
|
679 |
|
|
680 |
Example:: |
|
681 |
|
|
682 |
[ |
|
683 |
{ |
|
684 |
'external_reservations': '10.0.0.0, 10.0.0.1, 10.0.0.15', |
|
685 |
'free_count': 13, |
|
686 |
'gateway': '10.0.0.1', |
|
687 |
'gateway6': None, |
|
688 |
'group_list': ['default(bridged, prv0)'], |
|
689 |
'inst_list': [], |
|
690 |
'mac_prefix': None, |
|
691 |
'map': 'XX.............X', |
|
692 |
'name': 'nat', |
|
693 |
'network': '10.0.0.0/28', |
|
694 |
'network6': None, |
|
695 |
'network_type': 'private', |
|
696 |
'reserved_count': 3, |
|
697 |
'tags': ['nfdhcpd'] |
|
698 |
}, |
|
699 |
] |
|
700 |
|
|
701 |
``POST`` |
|
702 |
~~~~~~~~ |
|
703 |
|
|
704 |
Creates a network. |
|
705 |
|
|
706 |
If the optional bool *dry-run* argument is provided, the job will not be |
|
707 |
actually executed, only the pre-execution checks will be done. |
|
708 |
|
|
709 |
Returns: a job ID that can be used later for polling. |
|
710 |
|
|
711 |
Body parameters: |
|
712 |
|
|
713 |
.. opcode_params:: OP_NETWORK_ADD |
|
714 |
|
|
715 |
Job result: |
|
716 |
|
|
717 |
.. opcode_result:: OP_NETWORK_ADD |
|
718 |
|
|
719 |
|
|
720 |
``/2/networks/[network_name]`` |
|
721 |
++++++++++++++++++++++++++++++ |
|
722 |
|
|
723 |
Returns information about a network. |
|
724 |
|
|
725 |
It supports the following commands: ``GET``, ``DELETE``. |
|
726 |
|
|
727 |
``GET`` |
|
728 |
~~~~~~~ |
|
729 |
|
|
730 |
Returns information about a network, similar to the bulk output from |
|
731 |
the network list. |
|
732 |
|
|
733 |
Returned fields: :pyeval:`utils.CommaJoin(sorted(rlib2.NET_FIELDS))`. |
|
734 |
|
|
735 |
``DELETE`` |
|
736 |
~~~~~~~~~~ |
|
737 |
|
|
738 |
Deletes a network. |
|
739 |
|
|
740 |
It supports the ``dry-run`` argument. |
|
741 |
|
|
742 |
Job result: |
|
743 |
|
|
744 |
.. opcode_result:: OP_NETWORK_REMOVE |
|
745 |
|
|
746 |
|
|
747 |
``/2/networks/[network_name]/modify`` |
|
748 |
+++++++++++++++++++++++++++++++++++++ |
|
749 |
|
|
750 |
Modifies the parameters of a network. |
|
751 |
|
|
752 |
Supports the following commands: ``PUT``. |
|
753 |
|
|
754 |
``PUT`` |
|
755 |
~~~~~~~ |
|
756 |
|
|
757 |
Returns a job ID. |
|
758 |
|
|
759 |
Body parameters: |
|
760 |
|
|
761 |
.. opcode_params:: OP_NETWORK_SET_PARAMS |
|
762 |
|
|
763 |
Job result: |
|
764 |
|
|
765 |
.. opcode_result:: OP_NETWORK_SET_PARAMS |
|
766 |
|
|
767 |
|
|
768 |
``/2/networks/[network_name]/connect`` |
|
769 |
++++++++++++++++++++++++++++++++++++++ |
|
770 |
|
|
771 |
Connects a network to a nodegroup. |
|
772 |
|
|
773 |
Supports the following commands: ``PUT``. |
|
774 |
|
|
775 |
``PUT`` |
|
776 |
~~~~~~~ |
|
777 |
|
|
778 |
Returns a job ID. It supports the ``dry-run`` arguments. |
|
779 |
|
|
780 |
Body parameters: |
|
781 |
|
|
782 |
.. opcode_params:: OP_NETWORK_CONNECT |
|
783 |
|
|
784 |
Job result: |
|
785 |
|
|
786 |
.. opcode_result:: OP_NETWORK_CONNECT |
|
787 |
|
|
788 |
|
|
789 |
``/2/networks/[network_name]/disconnect`` |
|
790 |
+++++++++++++++++++++++++++++++++++++++++ |
|
791 |
|
|
792 |
Disonnects a network from a nodegroup. |
|
793 |
|
|
794 |
Supports the following commands: ``PUT``. |
|
795 |
|
|
796 |
``PUT`` |
|
797 |
~~~~~~~ |
|
798 |
|
|
799 |
Returns a job ID. It supports the ``dry-run`` arguments. |
|
800 |
|
|
801 |
Body parameters: |
|
802 |
|
|
803 |
.. opcode_params:: OP_NETWORK_DISCONNECT |
|
804 |
|
|
805 |
Job result: |
|
806 |
|
|
807 |
.. opcode_result:: OP_NETWORK_DISCONNECT |
|
808 |
|
|
809 |
|
|
810 |
``/2/networks/[network_name]/tags`` |
|
811 |
+++++++++++++++++++++++++++++++++++ |
|
812 |
|
|
813 |
Manages per-network tags. |
|
814 |
|
|
815 |
Supports the following commands: ``GET``, ``PUT``, ``DELETE``. |
|
816 |
|
|
817 |
``GET`` |
|
818 |
~~~~~~~ |
|
819 |
|
|
820 |
Returns a list of tags. |
|
821 |
|
|
822 |
Example:: |
|
823 |
|
|
824 |
["tag1", "tag2", "tag3"] |
|
825 |
|
|
826 |
``PUT`` |
|
827 |
~~~~~~~ |
|
828 |
|
|
829 |
Add a set of tags. |
|
830 |
|
|
831 |
The request as a list of strings should be ``PUT`` to this URI. The |
|
832 |
result will be a job id. |
|
833 |
|
|
834 |
It supports the ``dry-run`` argument. |
|
835 |
|
|
836 |
|
|
837 |
``DELETE`` |
|
838 |
~~~~~~~~~~ |
|
839 |
|
|
840 |
Delete a tag. |
|
841 |
|
|
842 |
In order to delete a set of tags, the DELETE request should be addressed |
|
843 |
to URI like:: |
|
844 |
|
|
845 |
/tags?tag=[tag]&tag=[tag] |
|
846 |
|
|
847 |
It supports the ``dry-run`` argument. |
|
848 |
|
|
849 |
|
|
649 | 850 |
``/2/instances-multi-alloc`` |
650 | 851 |
++++++++++++++++++++++++++++ |
651 | 852 |
|
Also available in: Unified diff