From c200e9a8b2c77f0cc15ff3bd64cef2f24c4cb249 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Mon, 29 Feb 2016 18:21:32 +0530 Subject: [PATCH 01/57] testing --- test.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 test.txt diff --git a/test.txt b/test.txt new file mode 100644 index 0000000..45b983b --- /dev/null +++ b/test.txt @@ -0,0 +1 @@ +hi From 91ddeb832660c4a8a58104429283692e31a8cd84 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Mon, 29 Feb 2016 18:43:01 +0530 Subject: [PATCH 02/57] fixed header and button color --- ntt_tool/__init__.pyc | Bin 0 -> 163 bytes ntt_tool/apps/__init__.pyc | Bin 0 -> 168 bytes ntt_tool/apps/cloud/__init__.pyc | Bin 0 -> 174 bytes ntt_tool/apps/cloud/admin.pyc | Bin 0 -> 231 bytes .../apps/cloud/migrations/0001_initial.pyc | Bin 0 -> 3020 bytes .../migrations/0002_auto_20160225_1631.pyc | Bin 0 -> 847 bytes .../migrations/0003_auto_20160225_1726.pyc | Bin 0 -> 1305 bytes .../migrations/0004_auto_20160226_1322.pyc | Bin 0 -> 1002 bytes ntt_tool/apps/cloud/migrations/__init__.pyc | Bin 0 -> 185 bytes ntt_tool/apps/cloud/models.pyc | Bin 0 -> 3491 bytes ntt_tool/apps/cloud/serializers.pyc | Bin 0 -> 2822 bytes ntt_tool/apps/cloud/urls.pyc | Bin 0 -> 601 bytes ntt_tool/apps/cloud/views.pyc | Bin 0 -> 3940 bytes ntt_tool/apps/core/__init__.pyc | Bin 0 -> 173 bytes ntt_tool/apps/core/urls.pyc | Bin 0 -> 391 bytes ntt_tool/apps/core/views.pyc | Bin 0 -> 776 bytes ntt_tool/settings.py | 2 +- ntt_tool/settings.pyc | Bin 0 -> 3451 bytes ntt_tool/static/css/custom.css | 58 +++++++++++++++++- ntt_tool/urls.pyc | Bin 0 -> 1556 bytes ntt_tool/wsgi.pyc | Bin 0 -> 622 bytes 21 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 ntt_tool/__init__.pyc create mode 100644 ntt_tool/apps/__init__.pyc create mode 100644 ntt_tool/apps/cloud/__init__.pyc create mode 100644 ntt_tool/apps/cloud/admin.pyc create mode 100644 ntt_tool/apps/cloud/migrations/0001_initial.pyc create mode 100644 ntt_tool/apps/cloud/migrations/0002_auto_20160225_1631.pyc create mode 100644 ntt_tool/apps/cloud/migrations/0003_auto_20160225_1726.pyc create mode 100644 ntt_tool/apps/cloud/migrations/0004_auto_20160226_1322.pyc create mode 100644 ntt_tool/apps/cloud/migrations/__init__.pyc create mode 100644 ntt_tool/apps/cloud/models.pyc create mode 100644 ntt_tool/apps/cloud/serializers.pyc create mode 100644 ntt_tool/apps/cloud/urls.pyc create mode 100644 ntt_tool/apps/cloud/views.pyc create mode 100644 ntt_tool/apps/core/__init__.pyc create mode 100644 ntt_tool/apps/core/urls.pyc create mode 100644 ntt_tool/apps/core/views.pyc create mode 100644 ntt_tool/settings.pyc create mode 100644 ntt_tool/urls.pyc create mode 100644 ntt_tool/wsgi.pyc diff --git a/ntt_tool/__init__.pyc b/ntt_tool/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7eac2efb07fef4df13ea90d8381a4ec497e27838 GIT binary patch literal 163 zcmZSn%**xF_DWbX0~9aG?OH<-gvJ&&s^Y!yeN=o8O^7C^*EHER!pt2+*KM&5=kB`sH%PfhH*8@s$ U01dRs%}*)KNwou6TMWbu06$_WH2?qr literal 0 HcmV?d00001 diff --git a/ntt_tool/apps/__init__.pyc b/ntt_tool/apps/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a6e91fcfa3e23c7c46c617688ff1f752e3b4e389 GIT binary patch literal 168 zcmZSn%**xF_DWbX0~9aG?OH<-gvJ&&s^Y!yeN=o8O^7C^*EHER!pt2+*KM&5=Pb?@X){l?R%*!l^ ZkJkgrasW-W$<0qG%}KQb*G?OH<-gvJ&&s^Y!yeN=o8O^7C^*EHER!pt2+*KM&5=Pb?@X)(30SkB`sH d%PfhH*8{5I0Ge%+o1apelWGTYK`{_B002^IEolG% literal 0 HcmV?d00001 diff --git a/ntt_tool/apps/cloud/admin.pyc b/ntt_tool/apps/cloud/admin.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5f88618ac9688b755c992b6e71222172b4d173f7 GIT binary patch literal 231 zcmY*TI}XAy40T!|AtabMM5g8ffH(mIAO@DIG!YaMyCUwuJ-G>D2B#n-Ea&<8^Bm`o z@#s0f?`rs3CUGe*P6e#E0uK-r>=h`R!A9rOXkKDk3FCo4WkZ82owPg=u;&VoRMdog zZ4PUxfc}TLmE4>tID_s&zKe#?)t)+Ae$)n;xnv@rSWn9K#wWsGZmPD8rWcw1ghB>} QvUnEAcHS-0fiZpj2DX?x%K!iX literal 0 HcmV?d00001 diff --git a/ntt_tool/apps/cloud/migrations/0001_initial.pyc b/ntt_tool/apps/cloud/migrations/0001_initial.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dc5286c1c24fd572b992e515aa399d185dc3f3f4 GIT binary patch literal 3020 zcmcguS#KLR5T2D}`G_4mhn=M9;WPoF7h6sb_e#<@wu1((Q$ThC)Gq`jQWE9Wa|OGkAvxb%V*U4pxj*jx_N)iRr;hIjP=j3HK;d5m zF~B&2!w4dp*C4LJxDJQ)Ft0=0fbkR@PQkbdhs}UCAfAT98BkN8r(iS-{RmVOeg${| z@YCTes0Qq}rtu8(7k*k1j@%MHd}4Z5X%QQzGa2VWGJ}#_J7wF}c1w{4zimej@ zA27I7>U>zyneh4ORp9EYz#A{`_Hn6m6V$h$9)Q{c^$^rH45mP>gSy4RXyfU1vT&nV zPNF*qa)jR5o9Yu@egV{{pfAGc5{xh{F2iUU)MubR#|>+E$^ZisoWA)_r+@Kpoc?7= zubNO_mEhN$hAdLwgqSnQcjvSDMm~27KI-0^)QZvx%&{5*^ZO<90rrX&=&LNOyW-PN4aimYU#B-e)8Jk}; zt3TIS*XCOA-n7l*9bcXmnuYvX#5x(cp#khR{sQXYR=Kl@7I@fD_$)RzvD5g4s>sth z*a*(7NM)WM+f121Np!io!s$dNE?7cssvse3;;4@?vBVyGlKE5-L6S{KqfAJp9Cb&V za(`o!dgLvkw38;zJ#D4B!pUx|J*{PD9%QoLH$6|?PR6l4#=WsCIw?|}^>pIoKzr)5 zPUlW!I`^>?sdPj3N8-m_oeA3)NbN{xxhKbGdTgB*{u_CLmgj86UtyH=%(LaWw%gK~GonkA+8D%fWgHzEa z_uQ zCY)C00Ob$op3VGnsUivkMA$U^nx2gV|HPKAetj@rQhR+wg4)}|a;o>{*tD)787?Kk zMJ5CnxDa>&@Ug}z75+hn&f*J3VjMP#4u^(9nIFqErLw`Gr8-eM>78`=0aLRYOF!xi9U}g`-0`%vrF79qSSGF^Icg-6f#pn7U3LTK9$tf(?)KLH z_SViWyToE8h6_>)7sBZy@8h&Rv}4^)^pTBy-o`e_87sp6?Zi1JoV78Hcp%aftnp+r zZ=)OYHZN+QUd7rQ8yk0o2~J;6PdXF~qLDwtN3+(fFE?hRX6<&gT=`zF)uXw3i7%pr z{^`3IZ4{%mmvnA0dOO-cv_<W=(U%_*kkfMJv&K{co_)#k&9i literal 0 HcmV?d00001 diff --git a/ntt_tool/apps/cloud/migrations/0002_auto_20160225_1631.pyc b/ntt_tool/apps/cloud/migrations/0002_auto_20160225_1631.pyc new file mode 100644 index 0000000000000000000000000000000000000000..754b84cc4c664b3f177f52a62118a35f30648f9b GIT binary patch literal 847 zcmc&zO^?$s5S@IqyInx4w0|O}O&Y|WScEumgF{wAq8H1=)7Fb)hkDGaXZVTy6SQX- zJKgP#D^4_-=ds6c-Z;hY7Z(pVzdrSF90h;hLJt0h9mQ`324Kiwok13H4km}8fOWyR z04(6HgiQvjgr5LE06wovP&2r#=A1$Q;ZbGm(UMKDx_1hN(S&@`iZ6549g(oiD7+>Eetz;OAvlJ;`5(LJG+mOP#FyfbQA6q8H=@m-pLDQfY4iaz70 z_dBtbg!l4L<&6KqAnBDdh_qjb#7T(3sbG*{JWk<=R-x@R`Y!1jkLj4*fbTULl{UGN zzAvm@zBN6qjEl~JTDgIBAfH`v5E~jmbnQO_FQJiQ;;sf hMCeL=Nrk2)r%ICdf67TsdOfw}P5fbe$!3`^i@zy()ZYLA literal 0 HcmV?d00001 diff --git a/ntt_tool/apps/cloud/migrations/0003_auto_20160225_1726.pyc b/ntt_tool/apps/cloud/migrations/0003_auto_20160225_1726.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d2b739e564517d89a8921e32e67f1b8e63b03052 GIT binary patch literal 1305 zcmc&z!EVz)5FOizle9^xK!7-Kw>ZRUs+J2NLfQ%m3X;}|Zm`#fp5Y_- zF#ZH_hM9HTqF&&JZH;GVXJ+Tky!C#JwthbU{vn0U;0f*Ku zNEZqZVy{_yAUjZWA?`xqL+m%!4#*zFec)XXUC0Npbb$Nt72pfN$9Mp|1B;-CXJo(d z2^`eSE{a-Zspf*o%!o3PRkPE_ok|#!sZ|xYAiM!p3cQDOb4Y$F&C zzuV!%zlDz|Tx>%=++xO{D!L}kOd_#P2z5kUw}B_R6xm9>5m%N-JWte08w%kU_88k3 zB$^>a^VwoPJ35XmXK7%w^Rw6Nd~qDH)AvWmZ*5AwM*3QA2Iv7dqWX->@KP5dRN|AC zbrotQ?6_HTaHxzi%xEo1vkF^ZnM4w$*PfP4zpEZnmK~$*vD0bal=YccyeglxTJg@)& literal 0 HcmV?d00001 diff --git a/ntt_tool/apps/cloud/migrations/0004_auto_20160226_1322.pyc b/ntt_tool/apps/cloud/migrations/0004_auto_20160226_1322.pyc new file mode 100644 index 0000000000000000000000000000000000000000..277d38dde53d6f1d3cdda79dd039830c65bb7904 GIT binary patch literal 1002 zcmc&yO>@&Q5M6)7P12U>3I2jlb>c#~KnLgyH#oQqGvuOiBPDSvOU9Cz_8fj9|AgTT zyX&?YZrspl)^AtR`t80=ejZPMz5ele3HK|(?;D80T_TXUBhUbC1d9kF@?+33v#R%jGuJR1?G{14>5h8zrCYWYvr4qXFs;{-nV>+3l zX`6Ll`^FmQ>0OJrwDS{$A0AE~nLfejJ7OvjC?JCJ2-e6nWUANbZ9f z$OBLrY!5(=L5)F9Ku$p(65c_AdmY1K0@YQ1jQSDDq~?^4N_iEm5y{c IiJvBa00;H&g8%>k literal 0 HcmV?d00001 diff --git a/ntt_tool/apps/cloud/migrations/__init__.pyc b/ntt_tool/apps/cloud/migrations/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cc13e061d2ec5c93d8293c39101869007a47e6f7 GIT binary patch literal 185 zcmZ8bK?(vf46Nuu1pl!o^8poK;6?Bn>bC4w+oag^;6MF|csE_dgMpb$h6&01wO+k< z&vS3SHPe1jl!cNr=F~Ok*eRJmDi`%&AZ0GC_I9s#?AhtnOphF& zI5>ZT|HVH+T)4nj)w{D}hY*28;)_ ziNS9~IngMhG@^**nDUrL9ZEYv?od8Qqj^f_AU1k zc}(|nSDQ-#e!~I&0+S_<%f@ulnFM=5QHm%UO^gsC#5U7(M1z1DpE=Piv^2p7vB3wi z;PGYgS($3^c+jkpL3-e`*aW{u$-(Y2cISB*=~pVZ#jzh|ge+ta7ct-Pm3J=ZnM~C9 z+z(yR$UQwCS3P;C7mjsre4Z@e%?yYt#?XzznjBTa`$?8~V3X(B{!o`sGMk5ta2WnN z)Tj2m^4O3<28XIHbI;*7+8T(u>^Ig`b>>RrZ?yfqEp*`}JMw~WwYP`a$j(+gENd%i z>z5Wrqg)|kJvI|j;+Z8*X8&XM_)xh_Do$ZH+MIr3%woZjRLxa<8;WOMFz?(vEC5tO)^_S6Q#GN z8kpE8N)bLB?vlCH6!11z(>|kjzSNHbW<>Fn6%P&tL{kr2Uh%Ny z)PqT}asce3!j*nlGv*Iie&F4M=b~a4F+LJUaS;oDu*mY8?3q0K9JZptN^k*19#zK^;(T>*|&w)$5!rT54fn(R)C5c zYd@6bfoywhC(O%)ThyZ?TPinDV9`@sR-X4$+L7~C3Ej42CR?$~yFuAQXFQ`l!`cI7 z>Qeg*M9Pm$DA=EmZL-NS6S;kb9-+{=8oJ6SyneF91LOQX^X*M6$;(zBW9Y`6D14SW zo6)ss73|A@{8^3eNB08@^IqF592lZ%>Z~E-tDTGm^-AY<5lvf{E;nu_v?ZZYnQ9EW z9rR&nQ5J>smL_cs`V)Rh7la+9p>L61Mcg7LX7o1DfXn&8C%ZSo|8U9&{Iyr zly>>9o)vhg=R2(9AO!K3awN6ht`1Ios17cfsv4?e9LSkIPnfa;^K*ZKbbiocVLJPi zcgV%wjc%eW?#s9tKc6+mN)2jXm*_wfxRJk&!AMWJ*9R+<+0h=ib$g*@3?XtaIPoz@ rp*`eF>>2;FAPgv}On3wD?f#Me`SZ|Cf5`_?@%6V6;nUe!-?{r2V9Ok0 literal 0 HcmV?d00001 diff --git a/ntt_tool/apps/cloud/serializers.pyc b/ntt_tool/apps/cloud/serializers.pyc new file mode 100644 index 0000000000000000000000000000000000000000..73d812914b62cb5ac9282ddaeaefd537b1daa647 GIT binary patch literal 2822 zcmd5;!EVz)5FOizlcp_HfRF+RAx;(t`~!ecxl#_B2#H)QE4!g?9Xs-FfO3Vu;J5e_ z#2MzTleJqoAkj97>dEYmxBK?ZyvYVX_6I+oe}6lr)hFQZm;C5&Y$X4AloQQ8nt0@4 z>{IU3SO%m#Itggzk?hb{qAx`6CLNO9Rv>hNF3Dai(0755_x)7noI*rFr&QRl1%;aQ`U#%bFUBO zlNd$d#dO#lDU-V8*uXBoa8&?fK-Gq7&e%! zch$haHvnijp>OW-m!)l7rL$Q!eVu9Zzja{G^=A#BB9$$nx&}D=JVOyEYDh7AJZvKp zeZ0g^%Um@}NDScCENxBlpb5~kPToWI&rzjJm8lQvaubM3ImE80m39IpCzCr`K$9+{ zj67zx*#PIXQY$?R1gy}lsGGn=jayAL>Ojk~$+wD@YGIDW4*nHCEpr{UfcB*U4^rM9 zF{2i40oqE;ciC^(!{ye2Yv%tZWa09+frLG9tZa>V@iPkrt&;_a?PQHrkro^7y|@30 zNpGqJKX!C&O%@Lr(jy1Ue-oi287QJs+9b1zFDD<%>QwLy8MF+0718#Vb%a|d+;Ml1rP`v7`7x#lXa0s;?}yK23Ww$M{lv$-v&nc1kN~BCl>lL}2hxMmhn3%AA7lp>=)<-P z9{{T!U=Ox^$U1-n`0zj+a2N36Kjy@t!)vY@0rKX;G2Ai8`Va*JR#5!#3Iuy(l{K|& zL7zdb8^YSOgiX1nF56V)IA-To;Cgy2NKIZpn2K5?yoD z5sOyik-s_P7fz}|Bk|oO*5)6b(2-gw;EXV_wDxe4<0aArSja8x0%hpCawk5B2#m*?k zl=GDQ0#*DEzrdeRJi|G?l2#_S0?M(y?dh4G*_r9nr+X`ZtTzAr^!J;6HT|jJ|L1tz zZxAv5v`Um3Y1Pw8Qx8NBR4*v>is%*9s}%Z@N|w~9s(RHzud1Y`Ms?Mz7kW)4%WBk6 zy+)zeRnk;lu8h_STFc66HEgL}t>T8dr_^1ge(0^LxVbQ}G9Oq|acf~w+HsnS?|i8J)7Em(4Y3yVB>t`CsUnEeB&-p{Ju^7pdWb~ms5>( z<1BTy=y@Kd*LQAge{XMfvjdwhOd4cqVZ(h~^exCMNj8aZVmCY1&pp85FYveygjKwF z8>nGL4VQQoxK~@_ZQ5nE2e&koZAxQBnVmMKs5Y0DgN9)mjcgeDCVIkfl*N;TY89%y z+t<;`ZVheUJ6}ONN)nm*_jwq<cX!Z#s6#%2 z;iDY_%oYw|V}Uf6tdbsa3$=Oq z(&cQjYc^+ElFWjp0i8|BrAD{(ZP2+8-aT3q~iy zRl-C->I)VN5wP@Y5xr%nc^aJ(!2*9nfS6|~h_n01aC+?ptmqT-0>z6IFHxMQc$wk? z#XQQ)D^wX_=2eQ3ti;Hg|>Bc@c%L#Oqwi zyhHIW&FQ}hcuwZ^a~t_AF992eL^J_my^y$8(R$lG;A zFc3Xj(;5J(6D}Gt&vBvy)h?^BZ7Fxff#WFmsM^HcQp)Agz}e9L)VE{Lf>a*A^tA*c?Elz@&x=0FSqo0y`fjNd`T>1TZtpyUzu&q zC903itL6imT!tuNe99S?%adsxE2uKVHd>9=cAMcS-a^6T!`&R;3x`>LV9>1$Yt|xa z$^0iRw#qtwTHKRP{$Vq#!o>NW8R4WsI6U-QCqEd94+%yTK38nw3RatcZ8-UG`j$h} oQb4MDDI*L|`lPN^aQaE{N%a{o$}zES04lTJrfycw)z6*%8&>gQOaK4? literal 0 HcmV?d00001 diff --git a/ntt_tool/apps/core/__init__.pyc b/ntt_tool/apps/core/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d4be7bfefce6700f3ef5c875a0890980ed749d3e GIT binary patch literal 173 zcmZSn%**xF_DWbX0~9aG?OH<-gvJ&&s^Y!yeN=o8O^7C^*EHER!pt2+*KM&5=Pb?@X)=$naO4W~# f&&xasIaM;O8vJU((B0WGr0)9v}#41Oy3<1i@JezJQ>hQ6QWITYyurTfi&T z6j%aMZ0OSx>=JIvJtFHr>6DTX?voh|q8nqzf`V!ErQpf|nd@lX^SXCWnVauUQIU%# zIAn1>S8rxUTv2RyCT>#IrFdTvO|B^i^-RX?kIYlgQ(1(`EobnEFm?ZmC@F-0Gn43T z3QkA&ko=T&imvl%vhDXg9TBm`lsuyuw8IN-Q~Zmy8HTL8G&;??Dk}5dXCc|iy9-vB Jd9xF-QeS~zTwDME literal 0 HcmV?d00001 diff --git a/ntt_tool/apps/core/views.pyc b/ntt_tool/apps/core/views.pyc new file mode 100644 index 0000000000000000000000000000000000000000..72d19a0f0aa9155aeedd57f0771ef2d91fe60d25 GIT binary patch literal 776 zcmcgp%}&EG40hUWz$B!Bc!-|XI|78baT!u4O=6d*wB8SElTo`2&f^hz6T}(p46!GG zsQ&WVuAR?G{Bhj>ynLS&@Uvpsuf^zGpp?%*1yCE98ZhcdP(@J3Fpb5J0b`gMC_C^5 zum!lEcA)ISIO$3G@=I1?gz>3BgRaEJvbPP=+B?Est|Ph05;uG#JlpnhvajmAf${U36|;ezWb6lM~EL@QZ=u$u9K zkOrSxBo4v6nG@?ctBuk`7zCiPuyo;TOdYO#)l%vm7L{*HTR!G)?o-FiGO(|d1!C8) zyzuVVPxJMf(!w{GKFicJl)S#d9D@*2x$RyR$1job=TP HW)Ob^kN>^L literal 0 HcmV?d00001 diff --git a/ntt_tool/settings.py b/ntt_tool/settings.py index a4facaf..4d0d045 100644 --- a/ntt_tool/settings.py +++ b/ntt_tool/settings.py @@ -82,7 +82,7 @@ 'ENGINE': 'django.db.backends.mysql', 'NAME': 'ntt', 'USER': 'root', - 'PASSWORD': 'root', + 'PASSWORD': 'onecloud', 'HOST': 'localhost', 'PORT': '3306', } diff --git a/ntt_tool/settings.pyc b/ntt_tool/settings.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3ee8d9d8e513f78e9b2a2bec1da459ced59fa682 GIT binary patch literal 3451 zcmb6b*>=-L^x96G#1Qr!3Z_5_fyjhFSjwi@N-%gkmO`i=(2+e8TaFf^88r>B^b`9d zJ^g_8&PcKy5)Q@7%$>RWD&_u}FPtp@^}Y+qXAbw*_-B7-00@AIYX(Rb+zglq#BdhO zEYJ)Laxj=W089hT!Jdg{pn%Hy#C`!BtU$R0C zxr7K5d>K|9JY50u6OgMwu0anOi?B+r!>TX`HT(?bDL^U*jk*EkCL(VE`31MzKo)Sj z17s1myFl*Ywgg1Mtpuy)X~9PBOJV^nkDv!5XhlM()kGg2f_WCmBQVd&pq!WM1-V`X zvI^#S)g0qt_7P}rb84Q)X$-QkRvd$^+zHN1E2S2fV)49Bi`$Xw7F~z&Vz52- z$o2^;qE1-+-F73&eneMDw)HK}pRT(cqYaDf46d9vBJ|k33C25P z#tAyC887gavfRE;&BAS^jLUn6?oLoY9?MRRvN11{2B~<)d^lZM*b}@jzt5XE^Gy+l z#3W7OqzUyntrNOe$GW{yh%q%zcV}RCcd$#959=bg&7o*VHo-cNtfP!Zq03llER0ic z=;9<$Iw*zuB<)ls?s+3YGd_bnYijwO)~GO1I;q4`DuMASyslK+I-f;AZM7_MU<-Ii zS|lZvy+Z%s7S4k%x*CM2mUf~ZTl{~-A^n7{&)MBE`Mzw*mfA00WSOlTq#uR<5S|n# zd*vWr#-!OYs?CPZE~4l(Cdw}BIih(mJ+g?{g|TAN8OPe&W1n1}N2J!+s5Ug7i>1g= zHq^Q%fiMWT1U7Z8ErT2QRCc92v{YT+YPKs}yal*H*LM2>iy7WDbwhHltlVFfK&#m{ zq}_yW+mXxJo3Um4LO8S;!#P1L9J3CQUMQQ4hAJ0RF5*;oJjb;~^S_TNFpJ;nki&%4 z9pCXHuSWeI?~g^i`T=|5S9m{zA12P(sM?T%d%DnO)J=)yG(T)*d_fCk%8Njbj$X7RwH(JA}mQ_)%sSc-rB>V_2Efwoe zH8gAOH(4jd-eX)m-QI2)miD1lZO4oit!AkFWP(s@wdR)9*4Epa{)S&kZjDzy)7-jA!)34I)D61F=`-V18W63;c1AP#G)u8CPA z4|TQLkO$$Ku9e%GVZGC0r;IS7T;#Q)t!-{_F&L!>TE!BbqRYo*wV@k$i+4D}blLj# zYNb-sw$!$k296&^-gdKTSexxyx!G8kW)A|#mtAOR^;Qj|sq+&^x211Xg|J!@eMwSL z4OJMfb1@r4daSgOt@moJiufjuQek6FZES3+8>qZl(PH`4x@MV892mlX91B);`AK7R zs4d@b$f+VQhRJ0p3`}5Im@92UAMv li > a { + color: #e9e9df; +} +.navbar-default .navbar-nav > li > a:hover, +.navbar-default .navbar-nav > li > a:focus { + color: #fff; + background-color: transparent; +} + .navbar-header a { text-transform: uppercase; font-size: 14px; font-weight: 400; } +/* Headings */ + +.form_h2{ + color: #0E3D59; +} + +/* buttons */ + +/* table headings */ +th{ + color: #0E3D59; +} + +td > a{ + color: #555; +} + +.panel{ + border: 1px solid #fbfbfb; +} +.panel-info > .panel-heading{ + background-color: #ededed; + border: 1px solid #fbfbfb; +} + +.btn-primary{ + background-color: #0E3D59; + border: none; +} + .page-header { background: #f6f6f6; border-color: #e9e9e9; diff --git a/ntt_tool/urls.pyc b/ntt_tool/urls.pyc new file mode 100644 index 0000000000000000000000000000000000000000..95b0b255742550d4a68e8719ca0421b89a25eb72 GIT binary patch literal 1556 zcma)6O>f&q5FP5nwkUta0g?c{>>+?8z#);|Dl|m`BS8!l4WPI^=wOB>R}y9JF0nhT zn_lx5d+fg`a&BjqWbGsf5DHxF4ByPYc{{uPe-6Tr&;I%?gZ2sO|2e(xZyIudC5-{( zJtzZEJy`Z2V7m`xAJhPr15iU)4jbiB8&LyV>>G8Z#ArsZ86zWgIql*`S-SGCTVU9+rD`ZN+R@?4}^ z6sj^7=R&NkQ9`{>(yD5mckti0cwaIVaHm2FC2MLYmyai>ZDkvyrg5qeFzJpXUz!x2&H5>7Lnea7irXJwridQC$36}h~O zHnh{|+>0ZK3~do(<#Z-it(@~lvSv$YFZ3#6e#hx^FSz7|SCz~D{BzW(xnPw&?OOoa;%YHqKXd=IXqLC> z=LKtn408oaKjGFvzD(a_Vd0on%j%e;4(6AF62M_3_U;iXH L3HF0W!FR!b;s>#7 literal 0 HcmV?d00001 diff --git a/ntt_tool/wsgi.pyc b/ntt_tool/wsgi.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aa2bea456337b81ae7d4b35fe84f7c06cdb01004 GIT binary patch literal 622 zcmYjO!EO^V5OsFj6fGbXfjIk^1FXdn1PD;u5Co}23P`y)WX~m@kCY_madjd>|`L)gy?14;TkF` zi(*0&zO@)3N?L*JGmQ7k`5b^(cj$z7C7=i!lz0L6-^jn9;_SjEz=O{no&Q-zI!pq`XZ)e0{Nm4(*h zWdniKMXa4F+;3jf(STc|2MjfkP7!@W3_aw)(Yx2v@u{92pPfyn!&Cq5V=st(Lth1pf#(~nliRA(jjlX!m{GV%2eqi`})fewywiK1v{9^!qRL!(QQ87 zP%}#R|3iGsNA9ix72q8GCMpb2dE8jtmr|^+pH;GUL(}agtuXvM?;fLM=Pf3C-cRXe PvSWf_b|*W`?q`1h41=?5 literal 0 HcmV?d00001 From 37071df18095ae382401d4e4fad29858333d9861 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Mon, 29 Feb 2016 18:57:46 +0530 Subject: [PATCH 03/57] UI Changes --- ntt_tool/__init__.pyc | Bin 160 -> 167 bytes ntt_tool/apps/__init__.pyc | Bin 165 -> 172 bytes ntt_tool/apps/cloud/__init__.pyc | Bin 171 -> 178 bytes ntt_tool/apps/cloud/admin.pyc | Bin 228 -> 235 bytes .../apps/cloud/migrations/0001_initial.pyc | Bin 3014 -> 3028 bytes .../migrations/0002_auto_20160225_1631.pyc | Bin 841 -> 855 bytes .../migrations/0003_auto_20160225_1726.pyc | Bin 1299 -> 1313 bytes .../migrations/0004_auto_20160226_1322.pyc | Bin 996 -> 1010 bytes ntt_tool/apps/cloud/migrations/__init__.pyc | Bin 182 -> 189 bytes ntt_tool/apps/cloud/models.pyc | Bin 3470 -> 3519 bytes ntt_tool/apps/cloud/serializers.pyc | Bin 2751 -> 2828 bytes ntt_tool/apps/cloud/urls.pyc | Bin 1000 -> 1007 bytes ntt_tool/apps/cloud/views.pyc | Bin 5075 -> 5166 bytes ntt_tool/apps/core/__init__.pyc | Bin 170 -> 177 bytes ntt_tool/apps/core/urls.pyc | Bin 388 -> 395 bytes ntt_tool/apps/core/views.pyc | Bin 767 -> 788 bytes ntt_tool/settings.py | 2 +- ntt_tool/settings.pyc | Bin 3555 -> 3575 bytes ntt_tool/static/css/custom.css | 58 +++++++++++++++++- ntt_tool/static/images/logo.png | Bin 0 -> 4462 bytes ntt_tool/static/partials/cloud/cloud.html | 10 +-- .../static/partials/cloud/cloud_view.html | 2 +- .../partials/cloud/cloudtraffic_form.html | 24 +++++--- ntt_tool/static/partials/common/header.html | 2 +- ntt_tool/static/partials/index.html | 9 +-- ntt_tool/urls.pyc | Bin 1553 -> 1560 bytes ntt_tool/wsgi.pyc | Bin 619 -> 626 bytes 27 files changed, 83 insertions(+), 24 deletions(-) create mode 100644 ntt_tool/static/images/logo.png diff --git a/ntt_tool/__init__.pyc b/ntt_tool/__init__.pyc index e76aa3253da680688e1dbe1c5b30654fd8b6a3c4..6f5bd12c5fa31acbc30a33f16093f055057690b3 100644 GIT binary patch delta 82 zcmZ3$xSWxl`7}D383=9nV8Tq-X`iV&?r8)WqMfq8&$tA`5`FW|yIr*h2 X`gtWK@g@2BIq^lQ1^IB^#2Re?r}`S$ diff --git a/ntt_tool/apps/__init__.pyc b/ntt_tool/apps/__init__.pyc index 8480845171e590291d74f002cf9583be86f327f4..8b68333485d8cf6911053b6d194b5670b4c833c0 100644 GIT binary patch delta 82 zcmZ3=xQ3CP`7u85kJ!GxBp&_487*^K(jz_4D&mlXLP*Q{q#y67$mY i_47(f;`36=;}eroN^`)xlKlLf_=3ukjQqTbrDgz{$sTF| delta 75 zcmdnQxSElj`7}D1r3=9nV8Tq-X`iV&?r8)WqMfq8&$tA`5`FW|yIr*h2 X`gtWK@g@2BIq^lQ1^IB^#2PaIoJktA diff --git a/ntt_tool/apps/cloud/admin.pyc b/ntt_tool/apps/cloud/admin.pyc index 1f4e0e0926375ddd144fe4df94fe9cc4f18e5e67..7c93bfd7cb0b9391a7d62e3ae7ac892967b00931 100644 GIT binary patch delta 82 zcmaFD_?nTO`7z delta 75 zcmaFO_=J(2`7_rxV3=9nV8Tq-X`iV&?r8)WqMfq8&$tA`5`FW|yIr*h2 X`gtWK@g@2BIq^lQ1^IB^#2v-}%S{`Y diff --git a/ntt_tool/apps/cloud/migrations/0001_initial.pyc b/ntt_tool/apps/cloud/migrations/0001_initial.pyc index 30cab74951c4d73fd02fa31cd3148df322029360..8bc6879ca50504b61d1e41d997011ea3867bac8c 100644 GIT binary patch delta 157 zcmX>menp&}`7**|jHXE87^=x5~Trt0UVX6NUW7VGEdr6%X(m!`z0WF_XM w=j-Q{l*H$ymd7V1rIhA?c_sPzIq?ORB^mj7n+>=G87VbnvH_R=>oKTk{K8n^fU5vQ}q**Qc8353ySiyQj<%H_4D&mlXLP* hQ}pvnO5#iM^K;^hQVa6oyv^oZf{bMAp4`su3jl2KGJ*gA diff --git a/ntt_tool/apps/cloud/migrations/0002_auto_20160225_1631.pyc b/ntt_tool/apps/cloud/migrations/0002_auto_20160225_1631.pyc index 6512d1e91f73b7dc6b1704cfe789085a2febbf3e..f08eb573447d7c5904e48a66c0493909f925e882 100644 GIT binary patch delta 156 zcmX@fcAbr#`7**>jlfOBom#^fU5vQ}y#wv-5LGi}myKQj>G?OH<-gvJ&&s q^Y!yeO5*cU%i|N1Qc82cypsI^aO9c?=8;`WgATsrrdYDWy631x5K;smUe9`uTaO$vOF@ hDf)ROCGjQs`8n}LsRj9P-sF=kR+HZ_&!fbE2mt+BG^qdp diff --git a/ntt_tool/apps/cloud/migrations/0004_auto_20160226_1322.pyc b/ntt_tool/apps/cloud/migrations/0004_auto_20160226_1322.pyc index f814b293a23ff0b298be232606b8e44fd7166732..6bcb6b74497f25e37c9d25524bb72001ef0b8e3b 100644 GIT binary patch delta 156 zcmaFD{)wHP`7*{hiBOBom#^fU5vQ}y#wv-5LGi}myKQj>G?OH<-gvJ&&s s^Y!yeO5*cU%i|N1Qc82cypsI{Uz_c?=8;`WgATsrrdYDWy631x5K;smUe9`uTaO$vOF@ hDf)ROCGjQs`8n}LsRj9P-sA&J^C{76HTed!6aaU6HADaa diff --git a/ntt_tool/apps/cloud/migrations/__init__.pyc b/ntt_tool/apps/cloud/migrations/__init__.pyc index 21f91f53e780458cca5a69c321ebfa69a3fbe5ca..8f902f0832611bb9a21685d4a79f25e23b131b21 100644 GIT binary patch delta 82 zcmdnSxR;Tg`7}D463=9nV8Tq-X`iV&?r8)WqMfq8&$tA`5`FW|yIr*h2 X`gtWK@g@2BIq^lQ1^IB^#2QBcr8yel diff --git a/ntt_tool/apps/cloud/models.pyc b/ntt_tool/apps/cloud/models.pyc index 78d2321b47d929c1eeb17682cfc19b8c4a1c8e3c..59db54d0c62c84eb12e84b62b3bf7d2bb9c6b3a3 100644 GIT binary patch delta 519 zcmeB^-Y?D0{F#?4LF~##_DClCNCpN5{fzwFRQasaQ~z@3OS$=Z`=QT#M aT@UvD2JZRf8vt~|p*A4*rgRQCn diff --git a/ntt_tool/apps/cloud/serializers.pyc b/ntt_tool/apps/cloud/serializers.pyc index a4d098f95bf301faee7a8e3d48177af81c7ca532..f0f4e06f2c402c572890b3d5b07d7a786f76c12e 100644 GIT binary patch literal 2828 zcmd5;&2G~`5FXo!lco(6At412h?~U$AGjif%9V21L`dX-WwIOM*0C+`no_Rt7Q6;8 z!n5!IFyA^jZp8sag=5E?ot+);H@_b5`*`&A@wZnC+FTz0KjTM#;X(4xp_FLt(A*&h zv`eW=GwG3X=)|L?L$XJoi9Qj%p7%)hTMWNp^hpj{jA6s@N$#~6qlPgcx!+jq1 zF-?POj4%1YSK#o>>;tnZlQ>O2s#4dB;5;Jcm7F&G3+f(0^bQY-pk=Kj>-|e9 zm&7!HT}+RMV`bt-90yo&psB@`OLGqryg~sa%#epD%Hp+(A~UkYI+s-nvd^RiXJ@>u z(pr+&$k~dzXiqF;S+@qWCSp)lw$U)2KK%t2}Gy zFfIxmTEVbosz=4SfOZ3Zw9A9<)CjOBpnw2KyQc$aK!o#aXs)@FQL5M|8RePH)vAyiGQj)v#VwX>ZSi@_HZ;T@NQ8sU zZm9~hG9cB5MOsPKQIOnZ1R6+v2X~EPH?kepy#aWeK)J>9cA#8sfc#PU{+&BJavVNV zJDA=0z)l)yuDN^3X)~3@S;s{hG2afP8k6p_RzGM=wo@s1$gu7=(A<{+ikLxzQz~tu zWyyWaSzewBULk`rV!IY?`>bO$Fxw;*NMnKOFOb;+ks@%w|4$&>g*~bJuBS+RjqmoM MGx8=r-@}Rj6WVf>`v3p{ literal 2751 zcmd5;&2G~`5FXo!NqO-zxef2OUMwDtwZA9mTL!3`p*G6bG#$ zAUUE*c!Tj}Klu|nJTv>itm-VuvyZCQ%_209%}pMk<>gXNTKy$=PhfhF2SxC*agzQ1 z?UYMm5+W|9$HS>INo$S+tU1s$=E|j+2Mb=I5EdrjA&!e=q2kyKt*|KNGKbh_(Soxx zURHTy$?Ifi`W4TjvvQ%LU(M+#2wsT^@X=IU0)s$OX{ZJ)6V?C^)#mrkJf=HlBx(t*|W^P9w z&H7*?$~m*00t8HJl^7-CvaozyR&phV_&t4jixoRteBQDy2C)Yb1z;I0Rb|c$M0Jto zOQ|+p7Pt9m4T!#jZ*%;X8I5?}0WlH)wXqcpkQx+!rBQlfl)bR@%h#nr|TQ%lfV0 z6*A}%_P(L*4e1nDk2Mhms4CFY1=uT48v+MxkR+2fh*!xG?OH<-gvJ&&s k^Y!yeO5*cU%i|N1Qc82cypsI diff --git a/ntt_tool/apps/cloud/views.pyc b/ntt_tool/apps/cloud/views.pyc index 5490e557b25ee83a295220b81fa4b48ea94d8d31..6e8d6ac839dc4d483883e36c777ca4825f8bde2f 100644 GIT binary patch delta 953 zcmcbtzD|Rk`7*}0kRBN!MM^fU5vQ}y#wv-5LGi}myKQj>G?OH<-gvJ&&s z^Y!yeO5*cU%i|N1Qc82cypsI zvP@JkNOrO?#{?>vBe(e{hcY!nNN#cwS1wf?WXdf~oe)~en?Vf+O-|;!L=|(o`7cw& XoGk)ZC^cvE0l_Y6#JcR{`NAdu+`MOM delta 866 zcmZ3daao<6`7vH+c?ME@e(g3PlENHWJFA MC^BUy{}MI<0LoT5Pyhe` diff --git a/ntt_tool/apps/core/__init__.pyc b/ntt_tool/apps/core/__init__.pyc index 769be916623ccfca40aaa8050b17860c104c8907..ecfb35f818dde7fc71ab9331c9496e73e27318e0 100644 GIT binary patch delta 82 zcmZ3*xRH^a`7u7#JAzGxBp&_487*^K(jz_4D&mlXLP*Q{q#y67$mY i_47(f;`36=;}eroN^`)xlKlLf_=3ukjQqTbrKSLx}D3h3=9nV8Tq-X`iV&?r8)WqMfq8&$tA`5`FW|yIr*h2 X`gtWK@g@2BIq^lQ1^IB^#2QlokpLQp diff --git a/ntt_tool/apps/core/urls.pyc b/ntt_tool/apps/core/urls.pyc index 48b070e80f24fda915d107648a18335eb3f89357..4a082738e7092953f3c918e7704c13e8053237da 100644 GIT binary patch delta 84 zcmZo+?q+6Z{>;m@#rWbzb^%8FFa`z&{fzwFRQvOl9K0HYoq@&Et; delta 77 zcmeBXZeeC;{>;l|taD-`y8xqwKLZ1Uenx(7s(xZpN@6Nqk9ueolN*YC%4nH#v;a6ac0i8c6^E diff --git a/ntt_tool/apps/core/views.pyc b/ntt_tool/apps/core/views.pyc index 30bff5c3849917d97eb61cfa133958badb842559..1571661da29fd94c024b30d43def1924b639af10 100644 GIT binary patch delta 228 zcmey*I)#m$`7+07X3!xG?OH<-gvJ&&s z^Y!yeO5*cU%i|N1Qc82cypsI}HG>0SpWb`WgATsrrdYDWy631x5K;smUe9`uTaO$vOF@ pDf)ROCGjQs`8n}LsRj9P-ed(PnaML4Jt;Auo)XP6lYcQu0RUJ1N+AFM diff --git a/ntt_tool/settings.py b/ntt_tool/settings.py index b0709d8..5144bb1 100644 --- a/ntt_tool/settings.py +++ b/ntt_tool/settings.py @@ -82,7 +82,7 @@ 'ENGINE': 'django.db.backends.mysql', 'NAME': 'ntt', 'USER': 'root', - 'PASSWORD': 'root', + 'PASSWORD': 'onecloud', 'HOST': 'localhost', 'PORT': '3306', } diff --git a/ntt_tool/settings.pyc b/ntt_tool/settings.pyc index cd44a0d7719871d2783ae3decce679f96fad1f16..a88f971fc5cda5c2023229631e4c3a6d92c8fd6a 100644 GIT binary patch delta 309 zcmXv{%}T>S7@SQiDTRXIPt|CTqShM0y8c`L9zgIQ>?KrZNgHEUFhM+d=p*z=Bv0Zq z_yU5USGU1lX1Z?cm2F_jgkKXbJ^ r0P@+kjC_1zKariTjZGu%N!vD!#P%uMX li > a { + color: #e9e9df; +} +.navbar-default .navbar-nav > li > a:hover, +.navbar-default .navbar-nav > li > a:focus { + color: #fff; + background-color: transparent; +} + .navbar-header a { text-transform: uppercase; font-size: 14px; font-weight: 400; } +/* Headings */ + +.form_h2{ + color: #0E3D59; +} + +/* buttons */ + +/* table headings */ +th{ + color: #0E3D59; +} + +td > a{ + color: #555; +} + +.panel{ + border: 1px solid #fbfbfb; +} +.panel-info > .panel-heading{ + background-color: #ededed; + border: 1px solid #fbfbfb; +} + +.btn-primary{ + background-color: #0E3D59; + border: none; +} + .page-header { background: #f6f6f6; border-color: #e9e9e9; diff --git a/ntt_tool/static/images/logo.png b/ntt_tool/static/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..3fd811a8df9195cd54d36ba60ff79b17f3d8a0c7 GIT binary patch literal 4462 zcmV-!5s~hRP)604+w@`%n>kz<;sFNHUtRE5zZtK2-jj0ve_&F%ne>J*o^^WgsthGv5CRv zu)&({mp`gyMm=L`G&7QAnBVu!Crwp#y=pyGcOCD&5>;iW;fag|{sFLow)oTi`v@Qh zECd$BKf8Zl0KDlA#hY3~$WZuOcp@o`LJy8Ve^*6y?*VrKce$z^)wgc#W{oP?6Zr;k z4sZ~#VU4R-;3?n^;6YdQ(;C;mRD%Kz<22V$?zNC-@XdHc~BJWiA)Br0#d6f5&*x%DD|xx z$lDY+1~?x0=4y(4C3^FKD%cZg0{#p0hc3lOz!ktRT-D_RAm0MM4_wUZN9H#Gr+rzc zRs*JBPh=y^qjt{{*39DxT-C`{)Sm(xUDeMjtz)1V z5CwZ88vxG(TbIaQ2pr_9zE*R=ec*{~3ETthSR(rpSM|a^u5Sl+2gb#pH1Ks`13)lO zq%3A3CJW34rn#zfYIP6&rREBbAB&Fy`3lP z5m*Rm&J#Jk7BZ?;@WF}i zUBHl=@Aikmw)}8ae+^t&BI{yLWaDb^8eO`QS%UF3h;+S+WNo+)mB_h z5B@f=ULx(ktElfQi>n%8_OFvWYbSdmTU1kbH408Xo)!2~Z=Me%uIe)2KN87}z$Mkx zTk$B`6Ukugp}Kj&Ro$(c#(dR@Uwdx>qYIKh12(R7HL#){?1^kbPvrtUQb}EPz98Od zyEu`&4yCtV%c9apbX$qELEpgtlJWqMT$4Vu(#mS7;F_+XepQJd#ZM%X4~QS%{ic=* z&Q@4gonn&9yz66Zzxz$C6r87ch+n62{clpr2WFG(aPXDww>se+T&RlR0fr-EXM5Y3- zV!ZHI$EM{9ty2}_fR{ayYhriYUg=fAp2!Zs8yGMAQf4F(@CfCNi zD%ca*5O@w_1eWAcV3Mo4u+m1?=|8dk+quBMQ*6Wa9m|NJro>IbsnU6Gauk0S2eknRc8(0i5v{vi`hynKLFspUGb(g6fF*d;8)#gj^i9JB8{0$=B8e*+f7wR`o4c(xw86$ZQDNp4i19gd!_On$GKcY zie5|keE!s2E?1TVw{6>dipXuMdaj5p4uar0+qMJXQdND&vaFe^nv0^y&StakS9eF? ziR_B;z9^gxEd@rpsvnccIF@4N&ghSF0aSHs5xFs)P9Ip1wwbDK-p6&{Qq^zwM^-Hf z!|)d1bX9#wRX4&+Lr%y1)0c&1S^ER`1VQkS@B7cB)9GfL*GqM%~tx0P^{s@^hkH$FzoS^Z5F_+7A#Cd5| zU6ILTW_6c$9Oqn2(6;q~OQI-x)UvEU1H)DIO%eH_@B5vq`ZeHS$8in;{-ml;h{zU> zY+?dtBq zM*vCl%=@bF%Xt;}X&8q0?X=TQJr+n(sno?l6a>K*s`^9}MVA$1Pj6~!8ozSo${$;n zH9KxNt*xy)0=so}b#=^)R3;?ePf?(68rlwW? zzv*;(Z{WgwK7X#3KO5LXRWFR|x;2-}WrhtKHrDt3HWBeC=m@HMLsL`Jc)qZ$n$^_Q zG`^*!rF;E;yD$tb$8koA$b+hSNe~2^Ha9ml4WiX70S|5q(agz)Ik} zN(6S}`~K}BGB*f$=wR<;xGZZTnKpy8P&Zaw|GII+psrzdUY3zN4dK>HPWg zmlf8hsuO_MgCKZFRl|;sj-~x+PlC%SUhz8H6A>$Rn@lcV-%^W6tt(cnm?R?Kw=8Ri zg5(z9QxVCE$N~|Wv~1b3MnEmgS~Y=JV?Z!HpU)p8BKupGHCa{niK1vf5t%V(&YYDZ zvW~`s2>=oKgyIMTg)E8799_+QefZ&rR|7{`mi0Qu54zuhS>%gBZPmmP`;xPtt$}SU zVAm4YJX{OGOO`D8D2k#U1eBC^@?<;xeP z)9Kl^ZFj#P9|1OZ9A~a=+y4&`1i=hdZ4r^*#bxdWHVuN{k8#~ksp_wyD4G{VQ75oY zb93{hy|pKo%Po%Qsn(^m|Ql8DH4B65vw+b^o>6Z^|9yp~R< zpRA-U-NeCMl9sKz$sDsAv`0bWlkOUvuGFa<&vb-;DoC1XQEXr34_=e%)R?61MwC); zO(x-W`bRv5sFtMeMl@hnJ_@N>0FX6FI-Nc)ilSBbmP)0b>+I}&sgG;6T(M$BZpo4* zAH_?jTl>C$d$}@g+uo6a;Hx6?QMuQLVffgXF=Hmon>VkTP)bSNt#1L#5{VmBAz;WL zB6CHgLqv{DrBbt^D9Qmijx$UO3fu z=@>KE#vlj|wQYMF;8qb?6h+b8APCM(r_)ciw6yG3O%L`&t_A+JAZfNmvHfjpr2>XJ zB65bR-Yz2lqvoG@OUtr82*dD_Y&QEIKomvi2SKoE`7{i}M&R*GCUcUAypv9+zX?oH z)sy42k4woa;CNNN!}tBeL}b3>I1_+#RQ04xCNoh)cBg6v zQmO7&<1$t4(>k(D+{E{61IB8y5E~QHuciUOh6wkH$OKiLkxHfBZEI^A7q5rUSJmNB z6ups3rA~Al=XrW@ri-HJnp7%vr{g&9(8nPoQ54-LBDdPMZHveO4Gj&~hGCeGqUbu? zwr7Y)OArKa*|z=eXPGCL$dT4Gl9z_K;2*;<{268p(}O6AE*L(1_!5BFSm1k>WzB17X!y>81q(jRWHR?hQFIpY z%7_so4p3DM!|*g!eW!}sEv2*RqN;cz?*N4x^7DYL>K=ooNvG2XsOk@a_rox}sa%VX zfy5J;NzbDS=DVs}be}CW4JbU6VhrZAl73lpd{xL~GJl{ruGJdD6FHFLb10_47yH5Y zmbmWHO2Y=!89ZWVw989m-3zgTUDcN;eix6X=bWm}(BwzJ*hJd&Sf@R#D#v0X zk*QTl2k_Vr>8cW0O_*~H=6WJWR?*%%{lGKk!LuxtTVf=?Gp2**0ygUyDwp&fHF5uMO90U6dC+vxQ3lku-uOKT~%o3-MvF@u! zzUv=f$9N<-7%!8);$poI9MRVlwyb#3o=6&VsMFC@cKT+W+R=Sb*Ez0grmw>N3J4xg ztgpm4j@21_9tVEns=iY01r5)8+*s8Add Cloud
- +
- +
- +
- +
- +
Cancel diff --git a/ntt_tool/static/partials/cloud/cloud_view.html b/ntt_tool/static/partials/cloud/cloud_view.html index 6d20435..b20c8c8 100644 --- a/ntt_tool/static/partials/cloud/cloud_view.html +++ b/ntt_tool/static/partials/cloud/cloud_view.html @@ -25,7 +25,7 @@
\ No newline at end of file diff --git a/ntt_tool/static/partials/cloud/tenants/tenants_list.html b/ntt_tool/static/partials/cloud/tenants/tenants_list.html index 1b2b5e4..937a617 100644 --- a/ntt_tool/static/partials/cloud/tenants/tenants_list.html +++ b/ntt_tool/static/partials/cloud/tenants/tenants_list.html @@ -4,19 +4,14 @@

Tenants

- - - - + - - - - + +
Tenant NameRouter NameNetwork NameNetwork CIDREnabled
{$ item.name $}as{$ item.router_name $}{$ item.network_name $}{$ item.network_cidr $}{$ item.tenant_name $}{$ item.enabled $}
diff --git a/ntt_tool/static/partials/cloud/traffic/traffic_form.html b/ntt_tool/static/partials/cloud/traffic/traffic_form.html index 7587d23..7abe2b6 100644 --- a/ntt_tool/static/partials/cloud/traffic/traffic_form.html +++ b/ntt_tool/static/partials/cloud/traffic/traffic_form.html @@ -113,23 +113,19 @@

{$ event | capitalize:true $} Traffic

Available Tenants
- +
- - - - + + - - - - - + + +
Tenant NameRouter NameNetwork NameNetwork CIDREnabled
{$ item.name $}as{$ item.router_name $}{$ item.network_name $}{$ item.network_cidr $}
{$ tenant.tenant_name $}{$ tenant.enabled $}
-
+
No tenants available
@@ -138,23 +134,19 @@

{$ event | capitalize:true $} Traffic

Selected Tenants
- +
- + - - - + - + - - - - + +
Tenant NameRouter NameNetwork NameNetwork CIDREnabled
{$ item.name $}{$ item.router_name $}{$ item.network_name $}{$ item.network_cidr $}{$ tenant.tenant_name $}{$ tenant.enabled $}
-
+
No tenants selected
diff --git a/requirements.txt b/requirements.txt index 642f6ad..26906c3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,3 +9,6 @@ djangorestframework==3.3.2 djangorestframework-jwt==1.7.2 six==1.10.0 wsgiref==0.1.2 + +python-keystoneclient==1.6.0 +python-neutronclient==2.6.0 From aadfb216eb5f0374d921beb63b357641d142a0ea Mon Sep 17 00:00:00 2001 From: Abdul Gaffar Date: Wed, 16 Mar 2016 14:50:02 +0530 Subject: [PATCH 17/57] Completed integration of tenant discovery script --- .idea/workspace.xml | 146 +++++++++--------- .../apps/cloud/migrations/0001_initial.py | 6 +- .../migrations/0002_auto_20160315_1219.py | 20 --- .../migrations/0003_auto_20160315_1249.py | 20 --- .../migrations/0004_auto_20160315_1307.py | 20 --- ntt_tool/apps/cloud/models.py | 6 +- ntt_tool/apps/cloud/scripts/__init__.py | 0 .../apps/cloud/scripts/keystoneclientutils.py | 6 + .../apps/cloud/scripts/neutronclientutils.py | 6 + .../cloud/scripts/openstackclientutils.py | 29 ++++ .../cloud/scripts/tenantnetworkdiscovery.py | 67 ++++++++ ntt_tool/apps/cloud/serializers.py | 47 +++--- ntt_tool/apps/cloud/views.py | 35 ++--- .../js/apps/controllers/trafficcontroller.js | 29 +++- 14 files changed, 245 insertions(+), 192 deletions(-) delete mode 100644 ntt_tool/apps/cloud/migrations/0002_auto_20160315_1219.py delete mode 100644 ntt_tool/apps/cloud/migrations/0003_auto_20160315_1249.py delete mode 100644 ntt_tool/apps/cloud/migrations/0004_auto_20160315_1307.py create mode 100644 ntt_tool/apps/cloud/scripts/__init__.py create mode 100644 ntt_tool/apps/cloud/scripts/keystoneclientutils.py create mode 100644 ntt_tool/apps/cloud/scripts/neutronclientutils.py create mode 100644 ntt_tool/apps/cloud/scripts/openstackclientutils.py create mode 100644 ntt_tool/apps/cloud/scripts/tenantnetworkdiscovery.py diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 0a25a37..8bf6aa1 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,23 +3,14 @@ - - - + + + - - - - - - - - - @@ -57,24 +48,24 @@ - - + + - - - - + + - - + + - - - + + + + + @@ -83,17 +74,17 @@ - + - + - - + + @@ -119,11 +110,11 @@ - + - - + + @@ -192,12 +183,12 @@ @@ -208,9 +199,9 @@ @@ -932,7 +923,7 @@ - + @@ -940,7 +931,7 @@ - + @@ -970,9 +961,9 @@ - - + + @@ -1004,6 +995,14 @@ + + + + + + + + @@ -1205,14 +1204,6 @@ - - - - - - - - @@ -1225,7 +1216,6 @@ - @@ -1233,7 +1223,6 @@ - @@ -1241,7 +1230,6 @@ - @@ -1249,7 +1237,6 @@ - @@ -1257,7 +1244,6 @@ - @@ -1273,7 +1259,6 @@ - @@ -1305,80 +1290,87 @@ - - + - - + + - + - + - - + + - + - + - + - - - - + + - + - + - + - + - + + + + + + + + + + + - + - + - - + + diff --git a/ntt_tool/apps/cloud/migrations/0001_initial.py b/ntt_tool/apps/cloud/migrations/0001_initial.py index 581a170..dd606f2 100644 --- a/ntt_tool/apps/cloud/migrations/0001_initial.py +++ b/ntt_tool/apps/cloud/migrations/0001_initial.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-03-15 12:04 +# Generated by Django 1.9.2 on 2016-03-16 07:39 from __future__ import unicode_literals from django.conf import settings @@ -70,8 +70,8 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('tenant_id', models.CharField(max_length=100)), ('tenant_name', models.CharField(max_length=256)), - ('description', models.CharField(max_length=256)), - ('enabled', models.BooleanField()), + ('description', models.CharField(blank=True, max_length=256, null=True)), + ('enabled', models.BooleanField(default=False)), ('created_on', models.DateTimeField(auto_now=True)), ('updated_on', models.DateTimeField(auto_now_add=True)), ('cloud', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tenants', to='cloud.Cloud')), diff --git a/ntt_tool/apps/cloud/migrations/0002_auto_20160315_1219.py b/ntt_tool/apps/cloud/migrations/0002_auto_20160315_1219.py deleted file mode 100644 index 92d7340..0000000 --- a/ntt_tool/apps/cloud/migrations/0002_auto_20160315_1219.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-03-15 12:19 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('cloud', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='traffic', - name='tenants', - field=models.ManyToManyField(related_name='tenants', to='cloud.Tenant'), - ), - ] diff --git a/ntt_tool/apps/cloud/migrations/0003_auto_20160315_1249.py b/ntt_tool/apps/cloud/migrations/0003_auto_20160315_1249.py deleted file mode 100644 index 56114cb..0000000 --- a/ntt_tool/apps/cloud/migrations/0003_auto_20160315_1249.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-03-15 12:49 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('cloud', '0002_auto_20160315_1219'), - ] - - operations = [ - migrations.AlterField( - model_name='traffic', - name='tenants', - field=models.ManyToManyField(to='cloud.Tenant'), - ), - ] diff --git a/ntt_tool/apps/cloud/migrations/0004_auto_20160315_1307.py b/ntt_tool/apps/cloud/migrations/0004_auto_20160315_1307.py deleted file mode 100644 index 5bbe0e5..0000000 --- a/ntt_tool/apps/cloud/migrations/0004_auto_20160315_1307.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-03-15 13:07 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('cloud', '0003_auto_20160315_1249'), - ] - - operations = [ - migrations.AlterField( - model_name='traffic', - name='tenants', - field=models.ManyToManyField(blank=True, null=True, to='cloud.Tenant'), - ), - ] diff --git a/ntt_tool/apps/cloud/models.py b/ntt_tool/apps/cloud/models.py index c872562..ef5cae8 100644 --- a/ntt_tool/apps/cloud/models.py +++ b/ntt_tool/apps/cloud/models.py @@ -21,8 +21,8 @@ class Tenant(models.Model): cloud = models.ForeignKey(Cloud, blank=True, null=True, related_name="tenants") tenant_id = models.CharField(max_length=100) tenant_name = models.CharField(max_length=256) - description = models.CharField(max_length=256) - enabled = models.BooleanField() + description = models.CharField(max_length=256, blank=True, null=True) + enabled = models.BooleanField(default=False) creator = models.ForeignKey(User, blank=True, null=True) created_on = models.DateTimeField(auto_now=True) updated_on = models.DateTimeField(auto_now_add=True) @@ -77,7 +77,7 @@ class Traffic(models.Model): test_method = models.CharField(max_length=100) iperf_duration = models.IntegerField() tenant_type = models.CharField(max_length=20, choices=TYPE_CHOICES, default='all') - tenants = models.ManyToManyField(Tenant, blank=True, null=True) + tenants = models.ManyToManyField(Tenant) external_host = models.CharField(max_length=100, blank=True, null=True) ssh_gateway = models.CharField(max_length=100, blank=True, null=True) creator = models.ForeignKey(User, blank=True, null=True) diff --git a/ntt_tool/apps/cloud/scripts/__init__.py b/ntt_tool/apps/cloud/scripts/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ntt_tool/apps/cloud/scripts/keystoneclientutils.py b/ntt_tool/apps/cloud/scripts/keystoneclientutils.py new file mode 100644 index 0000000..0a28745 --- /dev/null +++ b/ntt_tool/apps/cloud/scripts/keystoneclientutils.py @@ -0,0 +1,6 @@ +from keystoneclient.v2_0 import client as keystone_client +from openstackclientutils import OpenStackClientUtils + + +class KeystoneClientUtils(OpenStackClientUtils): + client_class = keystone_client.Client diff --git a/ntt_tool/apps/cloud/scripts/neutronclientutils.py b/ntt_tool/apps/cloud/scripts/neutronclientutils.py new file mode 100644 index 0000000..a446a76 --- /dev/null +++ b/ntt_tool/apps/cloud/scripts/neutronclientutils.py @@ -0,0 +1,6 @@ +from neutronclient.v2_0 import client as neutron_client +from openstackclientutils import OpenStackClientUtils + + +class NeutronClientUtils(OpenStackClientUtils): + client_class = neutron_client.Client diff --git a/ntt_tool/apps/cloud/scripts/openstackclientutils.py b/ntt_tool/apps/cloud/scripts/openstackclientutils.py new file mode 100644 index 0000000..765e5ba --- /dev/null +++ b/ntt_tool/apps/cloud/scripts/openstackclientutils.py @@ -0,0 +1,29 @@ +class OpenStackClientUtils(object): + + def __init__(self, username, password, auth_url, tenant_name=None): + self.username = username + self.password = password + self.auth_url = auth_url + self.tenant_name = tenant_name + + def get_credentials(self): + return { + "username": self.username, + "password": self.password, + "auth_url": self.auth_url, + "tenant_name": self.tenant_name + } + + def get_client_instance(self): + credentials = self.get_credentials() + return self.client_class(**credentials) + + + + + + + + + + diff --git a/ntt_tool/apps/cloud/scripts/tenantnetworkdiscovery.py b/ntt_tool/apps/cloud/scripts/tenantnetworkdiscovery.py new file mode 100644 index 0000000..b910e17 --- /dev/null +++ b/ntt_tool/apps/cloud/scripts/tenantnetworkdiscovery.py @@ -0,0 +1,67 @@ +from django.db import transaction +from keystoneclientutils import KeystoneClientUtils +from neutronclientutils import NeutronClientUtils +from ntt_tool.apps.cloud.models import Tenant, Network, Router +from ntt_tool.apps.cloud.serializers import TenantSerializer + + +class TenantDiscovery(KeystoneClientUtils): + + def get_tenants(self): + keystone = self.get_client_instance() + return keystone.tenants.list() + + +class NetworkRouterDiscovery(NeutronClientUtils): + + def get_networks_and_routers(self, user, cloud_id, tenants): + neutron = self.get_client_instance() + + discovery_result = [] + + with transaction.atomic(): + Tenant.objects.filter(cloud_id=cloud_id).delete() + + for tenant in tenants: + tenant_obj = Tenant() + tenant_obj.cloud_id = cloud_id + tenant_obj.tenant_id = tenant.id + tenant_obj.tenant_name = tenant.name + tenant_obj.description = tenant.description + tenant_obj.enabled = tenant.enabled + tenant_obj.creator = user + tenant_obj.save() + + # ToDo: Need to update status, vlan, network_cidr + networks_list = [] + networks = neutron.list_networks(tenant_id=tenant.id) + for network in networks.get("networks", []): + network_obj = Network() + network_obj.tenant = tenant_obj + network_obj.network_name = network.get("name") + # ToDo: We are assuming that each network is having only one subnet + # ToDo: Need to handle the scenario if we add more than one subnet for a network + if network.get("subnets"): + subnet_list = neutron.list_subnets(id=network.get("subnets")) + network_obj.network_cidr = subnet_list.get("subnets")[0].get("cidr") + network_obj.status = network.get("status") + network_obj.creator = user + networks_list.append(network_obj) + Network.objects.bulk_create(networks_list) + + # ToDo: Need to update status + routers_list = [] + routers = neutron.list_routers(tenant_id=tenant.id) + for router in routers.get("routers", []): + router_obj = Router() + router_obj.tenant = tenant_obj + router_obj.router_id = router.get("id") + router_obj.router_name = router.get("name") + router_obj.status = router.get("status") + router_obj.creator = user + routers_list.append(router_obj) + Router.objects.bulk_create(routers_list) + + serializer = TenantSerializer(tenant_obj) + discovery_result.append(serializer.data) + return discovery_result diff --git a/ntt_tool/apps/cloud/serializers.py b/ntt_tool/apps/cloud/serializers.py index 0edbc74..d747d97 100644 --- a/ntt_tool/apps/cloud/serializers.py +++ b/ntt_tool/apps/cloud/serializers.py @@ -23,6 +23,12 @@ class Meta: exclude = ('creator', 'created_on', 'updated_on',) +class TenantListSerializer(serializers.ModelSerializer): + class Meta: + model = Tenant + fields = ('id', 'tenant_name', 'enabled', 'description') + + class TenantSerializer(serializers.ModelSerializer): networks = NetworkSerializer(many=True, read_only=True) routers = RouterSerializer(many=True, read_only=True) @@ -32,12 +38,6 @@ class Meta: exclude = ('creator', 'created_on', 'updated_on',) -# class TrafficTenantSerializer(serializers.ModelSerializer): -# -# class Meta: -# model = TrafficTenants - - class TrafficListSerializer(serializers.ModelSerializer): class Meta: @@ -45,20 +45,29 @@ class Meta: exclude = ('creator', 'updated_on',) -class TrafficRetrieveSerializer(serializers.ModelSerializer): - tenants = TenantSerializer(many=True) - - class Meta: - model = Traffic - fields = ('id', 'cloud', 'name', 'allowed_delta_percentage', 'test_result_path', - 'number_of_workers', 'remote_user', 'remote_pass', 'test_method', - 'iperf_duration', 'tenant_type', 'tenants', 'external_host', 'ssh_gateway',) - - class TrafficSerializer(serializers.ModelSerializer): + tenants = TenantListSerializer(many=True, required=False) class Meta: model = Traffic - fields = ('id', 'cloud', 'name', 'allowed_delta_percentage', 'test_result_path', - 'number_of_workers', 'remote_user', 'remote_pass', 'test_method', - 'iperf_duration', 'tenant_type', 'tenants', 'external_host', 'ssh_gateway',) + exclude = ('creator', 'updated_on',) + + def create(self, validated_data): + # get tenants + tenants_data = validated_data.pop("tenants") + # create traffic instance + traffic = self.Meta.model.objects.create(**validated_data) + for tenant_id in tenants_data: + traffic.tenants.add(tenant_id) + traffic.save() + return traffic + + def update(self, instance, validated_data): + # get tenants + instance.tenants.clear() + tenants_data = validated_data.pop("tenants") + for tenant in tenants_data: + tenant_obj = Tenant.objects.filter(**tenant).get() + instance.tenants.add(tenant_obj) + instance.save() + return instance diff --git a/ntt_tool/apps/cloud/views.py b/ntt_tool/apps/cloud/views.py index 303e28b..e54932f 100644 --- a/ntt_tool/apps/cloud/views.py +++ b/ntt_tool/apps/cloud/views.py @@ -24,6 +24,18 @@ class TenantViewSet(viewsets.ModelViewSet): serializer_class = TenantSerializer authentication_classes = (JSONWebTokenAuthentication,) permission_classes = (IsAuthenticated,) + action_serializers = { + 'retrieve': TenantSerializer, + 'list': TenantListSerializer, + 'create': TenantSerializer, + 'update': TenantSerializer, + } + + def get_serializer_class(self): + if hasattr(self, 'action_serializers'): + if self.action in self.action_serializers: + return self.action_serializers[self.action] + return super(TrafficViewSet, self).get_serializer_class() def list(self, request, *args, **kwargs): cloud_id = self.request.GET.get("cloud_id") @@ -96,34 +108,13 @@ def list(self, request, *args, **kwargs): serializer = self.get_serializer(queryset, many=True) return Response(serializer.data) - def parse_tenants(self): - return ",".join([str(x) for x in self.request.data.get("tenants", [])]) - - def create(self, request, *args, **kwargs): - import pdb - pdb.set_trace() - serializer = self.get_serializer(data=request.data) - serializer.is_valid(raise_exception=True) - self.perform_create(serializer) - headers = self.get_success_headers(serializer.data) - return Response(serializer.data, status=status.HTTP_201_CREATED, headers=headers) - def perform_create(self, serializer): - - import pdb - pdb.set_trace() - serializer.save( - # tenants=self.parse_tenants(), + tenants=self.request.data.getlist("tenants[]"), creator=self.request.user, cloud_id=self.request.data.get("cloud_id") ) - def perform_update(self, serializer): - serializer.save( - tenants=self.parse_tenants(), - ) - @detail_route(methods=["get"], url_path="test") def test(self, request, pk=None): return Response("hey") \ No newline at end of file diff --git a/ntt_tool/static/js/apps/controllers/trafficcontroller.js b/ntt_tool/static/js/apps/controllers/trafficcontroller.js index 02e0040..18282f0 100644 --- a/ntt_tool/static/js/apps/controllers/trafficcontroller.js +++ b/ntt_tool/static/js/apps/controllers/trafficcontroller.js @@ -22,7 +22,7 @@ nttApp.controller('TrafficCtrl', function($scope, $routeParams, $location, traff "cloud_id": $scope.cloudId, "tenant_type": "all", "test_method": "icmp", - "tenants": [] + "tenants": [], }; if ($scope.event == "edit"){ @@ -35,7 +35,22 @@ nttApp.controller('TrafficCtrl', function($scope, $routeParams, $location, traff $scope.tenants = []; $scope.getTenants = function(){ tenantService.list($scope.cloudId).then(function(response){ - $scope.tenants = response; + if ($scope.event == 'add'){ + $scope.tenants = response; + } + else { + angular.forEach(response, function(tenant, i){ + var isSelected = false; + angular.forEach($scope.cloudTraffic.tenants, function(selectedTenant, j){ + if (tenant.tenant_name == selectedTenant.tenant_name){ + isSelected = true; + } + }); + if (!isSelected){ + $scope.tenants.push(tenant); + } + }); + } }); }; if($scope.event == 'add'){ @@ -59,16 +74,14 @@ nttApp.controller('TrafficCtrl', function($scope, $routeParams, $location, traff angular.forEach($scope.cloudTraffic.tenants, function(item, index){ selectedList.push(item.id); }); - return JSON.stringify(selectedList); + console.log(selectedList) + return selectedList; }; $scope.save = function(){ - - var cloudTraffic = angular.copy($scope.cloudTraffic); - cloudTraffic["tenants"] = $scope.getSelectedTenants(); - console.log(cloudTraffic) if($scope.event == "add") { - trafficService.create(cloudTraffic).then(function (response) { + $scope.cloudTraffic["tenants"] = $scope.getSelectedTenants() + trafficService.create($scope.cloudTraffic).then(function (response) { $location.path("cloud/view/" + $scope.cloudId + "/"); }); } From 217615a0de3d6264bcc8e483e5f1f6d0875cfb9b Mon Sep 17 00:00:00 2001 From: Abdul Gaffar Date: Mon, 21 Mar 2016 16:15:21 +0530 Subject: [PATCH 18/57] Added feature to upload image and launch VM on network --- .../apps/cloud/migrations/0001_initial.py | 4 +- .../migrations/0002_auto_20160318_1057.py | 37 ++++++++++ .../migrations/0003_auto_20160318_1153.py | 47 ++++++++++++ .../migrations/0004_auto_20160321_0621.py | 52 ++++++++++++++ .../migrations/0005_auto_20160321_0630.py | 52 ++++++++++++++ .../migrations/0006_auto_20160321_0634.py | 30 ++++++++ ntt_tool/apps/cloud/models.py | 6 ++ .../apps/cloud/scripts/keystoneclientutils.py | 7 ++ .../cloud/scripts/openstackclientutils.py | 14 +--- .../cloud/scripts/tenantnetworkdiscovery.py | 66 +++++++++++++---- ntt_tool/apps/cloud/views.py | 28 ++++++++ ntt_tool/settings.py | 3 +- .../js/apps/controllers/cloudcontroller.js | 71 +++++++------------ .../js/apps/controllers/trafficcontroller.js | 8 ++- .../static/js/apps/services/trafficservice.js | 6 +- .../static/partials/cloud/cloud_form.html | 2 +- .../partials/cloud/tenants/tenants_list.html | 8 ++- .../partials/cloud/traffic/traffic_form.html | 16 +++-- .../partials/cloud/traffic/traffic_list.html | 4 +- .../partials/cloud/traffic/traffic_test.html | 28 +++++++- requirements.txt | 5 +- 21 files changed, 406 insertions(+), 88 deletions(-) create mode 100644 ntt_tool/apps/cloud/migrations/0002_auto_20160318_1057.py create mode 100644 ntt_tool/apps/cloud/migrations/0003_auto_20160318_1153.py create mode 100644 ntt_tool/apps/cloud/migrations/0004_auto_20160321_0621.py create mode 100644 ntt_tool/apps/cloud/migrations/0005_auto_20160321_0630.py create mode 100644 ntt_tool/apps/cloud/migrations/0006_auto_20160321_0634.py diff --git a/ntt_tool/apps/cloud/migrations/0001_initial.py b/ntt_tool/apps/cloud/migrations/0001_initial.py index dd606f2..aa6d7a7 100644 --- a/ntt_tool/apps/cloud/migrations/0001_initial.py +++ b/ntt_tool/apps/cloud/migrations/0001_initial.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-03-16 07:39 +# Generated by Django 1.9.2 on 2016-03-18 10:33 from __future__ import unicode_literals from django.conf import settings @@ -37,8 +37,10 @@ class Migration(migrations.Migration): name='Network', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('network_id', models.CharField(max_length=255)), ('network_name', models.CharField(max_length=255)), ('network_cidr', models.CharField(max_length=255)), + ('shared', models.BooleanField(default=False)), ('subnet', models.CharField(blank=True, max_length=255, null=True)), ('status', models.CharField(max_length=25)), ('created_on', models.DateTimeField(auto_now=True)), diff --git a/ntt_tool/apps/cloud/migrations/0002_auto_20160318_1057.py b/ntt_tool/apps/cloud/migrations/0002_auto_20160318_1057.py new file mode 100644 index 0000000..87af7a3 --- /dev/null +++ b/ntt_tool/apps/cloud/migrations/0002_auto_20160318_1057.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.2 on 2016-03-18 10:57 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('cloud', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='network', + name='created_on', + field=models.DateTimeField(default=datetime.datetime(2016, 3, 18, 10, 57, 43, 702918, tzinfo=utc)), + ), + migrations.AlterField( + model_name='network', + name='updated_on', + field=models.DateTimeField(default=datetime.datetime(2016, 3, 18, 10, 57, 43, 702965, tzinfo=utc)), + ), + migrations.AlterField( + model_name='router', + name='created_on', + field=models.DateTimeField(default=datetime.datetime(2016, 3, 18, 10, 57, 43, 704316, tzinfo=utc)), + ), + migrations.AlterField( + model_name='router', + name='updated_on', + field=models.DateTimeField(default=datetime.datetime(2016, 3, 18, 10, 57, 43, 704362, tzinfo=utc)), + ), + ] diff --git a/ntt_tool/apps/cloud/migrations/0003_auto_20160318_1153.py b/ntt_tool/apps/cloud/migrations/0003_auto_20160318_1153.py new file mode 100644 index 0000000..aba173d --- /dev/null +++ b/ntt_tool/apps/cloud/migrations/0003_auto_20160318_1153.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.2 on 2016-03-18 11:53 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('cloud', '0002_auto_20160318_1057'), + ] + + operations = [ + migrations.AlterField( + model_name='network', + name='created_on', + field=models.DateTimeField(default=datetime.datetime(2016, 3, 18, 11, 52, 59, 534942, tzinfo=utc)), + ), + migrations.AlterField( + model_name='network', + name='updated_on', + field=models.DateTimeField(default=datetime.datetime(2016, 3, 18, 11, 52, 59, 534987, tzinfo=utc)), + ), + migrations.AlterField( + model_name='router', + name='created_on', + field=models.DateTimeField(default=datetime.datetime(2016, 3, 18, 11, 52, 59, 536327, tzinfo=utc)), + ), + migrations.AlterField( + model_name='router', + name='updated_on', + field=models.DateTimeField(default=datetime.datetime(2016, 3, 18, 11, 52, 59, 536372, tzinfo=utc)), + ), + migrations.AlterField( + model_name='tenant', + name='created_on', + field=models.DateTimeField(default=datetime.datetime(2016, 3, 18, 11, 52, 59, 533215, tzinfo=utc)), + ), + migrations.AlterField( + model_name='tenant', + name='updated_on', + field=models.DateTimeField(default=datetime.datetime(2016, 3, 18, 11, 52, 59, 533260, tzinfo=utc)), + ), + ] diff --git a/ntt_tool/apps/cloud/migrations/0004_auto_20160321_0621.py b/ntt_tool/apps/cloud/migrations/0004_auto_20160321_0621.py new file mode 100644 index 0000000..2c1b595 --- /dev/null +++ b/ntt_tool/apps/cloud/migrations/0004_auto_20160321_0621.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.2 on 2016-03-21 06:21 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('cloud', '0003_auto_20160318_1153'), + ] + + operations = [ + migrations.AddField( + model_name='tenant', + name='is_dirty', + field=models.BooleanField(default=False), + ), + migrations.AlterField( + model_name='network', + name='created_on', + field=models.DateTimeField(default=datetime.datetime(2016, 3, 21, 6, 21, 29, 228959, tzinfo=utc)), + ), + migrations.AlterField( + model_name='network', + name='updated_on', + field=models.DateTimeField(default=datetime.datetime(2016, 3, 21, 6, 21, 29, 229004, tzinfo=utc)), + ), + migrations.AlterField( + model_name='router', + name='created_on', + field=models.DateTimeField(default=datetime.datetime(2016, 3, 21, 6, 21, 29, 230319, tzinfo=utc)), + ), + migrations.AlterField( + model_name='router', + name='updated_on', + field=models.DateTimeField(default=datetime.datetime(2016, 3, 21, 6, 21, 29, 230377, tzinfo=utc)), + ), + migrations.AlterField( + model_name='tenant', + name='created_on', + field=models.DateTimeField(default=datetime.datetime(2016, 3, 21, 6, 21, 29, 227286, tzinfo=utc)), + ), + migrations.AlterField( + model_name='tenant', + name='updated_on', + field=models.DateTimeField(default=datetime.datetime(2016, 3, 21, 6, 21, 29, 227333, tzinfo=utc)), + ), + ] diff --git a/ntt_tool/apps/cloud/migrations/0005_auto_20160321_0630.py b/ntt_tool/apps/cloud/migrations/0005_auto_20160321_0630.py new file mode 100644 index 0000000..ddfcdb2 --- /dev/null +++ b/ntt_tool/apps/cloud/migrations/0005_auto_20160321_0630.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.2 on 2016-03-21 06:30 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('cloud', '0004_auto_20160321_0621'), + ] + + operations = [ + migrations.AddField( + model_name='network', + name='is_dirty', + field=models.BooleanField(default=False), + ), + migrations.AlterField( + model_name='network', + name='created_on', + field=models.DateTimeField(auto_now=True), + ), + migrations.AlterField( + model_name='network', + name='updated_on', + field=models.DateTimeField(auto_now_add=True), + ), + migrations.AlterField( + model_name='router', + name='created_on', + field=models.DateTimeField(default=datetime.datetime(2016, 3, 21, 6, 30, 16, 414423, tzinfo=utc)), + ), + migrations.AlterField( + model_name='router', + name='updated_on', + field=models.DateTimeField(default=datetime.datetime(2016, 3, 21, 6, 30, 16, 414470, tzinfo=utc)), + ), + migrations.AlterField( + model_name='tenant', + name='created_on', + field=models.DateTimeField(auto_now=True), + ), + migrations.AlterField( + model_name='tenant', + name='updated_on', + field=models.DateTimeField(auto_now_add=True), + ), + ] diff --git a/ntt_tool/apps/cloud/migrations/0006_auto_20160321_0634.py b/ntt_tool/apps/cloud/migrations/0006_auto_20160321_0634.py new file mode 100644 index 0000000..47f9179 --- /dev/null +++ b/ntt_tool/apps/cloud/migrations/0006_auto_20160321_0634.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.2 on 2016-03-21 06:34 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cloud', '0005_auto_20160321_0630'), + ] + + operations = [ + migrations.AddField( + model_name='router', + name='is_dirty', + field=models.BooleanField(default=False), + ), + migrations.AlterField( + model_name='router', + name='created_on', + field=models.DateTimeField(auto_now=True), + ), + migrations.AlterField( + model_name='router', + name='updated_on', + field=models.DateTimeField(auto_now_add=True), + ), + ] diff --git a/ntt_tool/apps/cloud/models.py b/ntt_tool/apps/cloud/models.py index ef5cae8..ef6a6b4 100644 --- a/ntt_tool/apps/cloud/models.py +++ b/ntt_tool/apps/cloud/models.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals from django.contrib.auth.models import User from django.db import models +from django.utils import timezone class Cloud(models.Model): @@ -23,6 +24,7 @@ class Tenant(models.Model): tenant_name = models.CharField(max_length=256) description = models.CharField(max_length=256, blank=True, null=True) enabled = models.BooleanField(default=False) + is_dirty = models.BooleanField(default=False) creator = models.ForeignKey(User, blank=True, null=True) created_on = models.DateTimeField(auto_now=True) updated_on = models.DateTimeField(auto_now_add=True) @@ -33,10 +35,13 @@ class Meta: class Network(models.Model): tenant = models.ForeignKey(Tenant, related_name="networks") + network_id = models.CharField(max_length=255) network_name = models.CharField(max_length=255) network_cidr = models.CharField(max_length=255) + shared = models.BooleanField(default=False) subnet = models.CharField(max_length=255, blank=True, null=True) status = models.CharField(max_length=25) + is_dirty = models.BooleanField(default=False) creator = models.ForeignKey(User, blank=True, null=True) created_on = models.DateTimeField(auto_now=True) updated_on = models.DateTimeField(auto_now_add=True) @@ -50,6 +55,7 @@ class Router(models.Model): router_id = models.CharField(max_length=255) router_name = models.CharField(max_length=255) status = models.CharField(max_length=25) + is_dirty = models.BooleanField(default=False) creator = models.ForeignKey(User, blank=True, null=True) created_on = models.DateTimeField(auto_now=True) updated_on = models.DateTimeField(auto_now_add=True) diff --git a/ntt_tool/apps/cloud/scripts/keystoneclientutils.py b/ntt_tool/apps/cloud/scripts/keystoneclientutils.py index 0a28745..0f8ab58 100644 --- a/ntt_tool/apps/cloud/scripts/keystoneclientutils.py +++ b/ntt_tool/apps/cloud/scripts/keystoneclientutils.py @@ -4,3 +4,10 @@ class KeystoneClientUtils(OpenStackClientUtils): client_class = keystone_client.Client + + def __init__(self, **credentials): + super(KeystoneClientUtils, self).__init__(**credentials) + self.keystone = self.get_client_instance() + + def get_token(self): + return self.keystone.auth_ref.get("token", {}).get("id") \ No newline at end of file diff --git a/ntt_tool/apps/cloud/scripts/openstackclientutils.py b/ntt_tool/apps/cloud/scripts/openstackclientutils.py index 765e5ba..1ee1fb2 100644 --- a/ntt_tool/apps/cloud/scripts/openstackclientutils.py +++ b/ntt_tool/apps/cloud/scripts/openstackclientutils.py @@ -1,18 +1,10 @@ class OpenStackClientUtils(object): - def __init__(self, username, password, auth_url, tenant_name=None): - self.username = username - self.password = password - self.auth_url = auth_url - self.tenant_name = tenant_name + def __init__(self, **credentials): + self.credentials = credentials def get_credentials(self): - return { - "username": self.username, - "password": self.password, - "auth_url": self.auth_url, - "tenant_name": self.tenant_name - } + return self.credentials def get_client_instance(self): credentials = self.get_credentials() diff --git a/ntt_tool/apps/cloud/scripts/tenantnetworkdiscovery.py b/ntt_tool/apps/cloud/scripts/tenantnetworkdiscovery.py index b910e17..1f99edd 100644 --- a/ntt_tool/apps/cloud/scripts/tenantnetworkdiscovery.py +++ b/ntt_tool/apps/cloud/scripts/tenantnetworkdiscovery.py @@ -1,4 +1,5 @@ from django.db import transaction +from django.utils import timezone from keystoneclientutils import KeystoneClientUtils from neutronclientutils import NeutronClientUtils from ntt_tool.apps.cloud.models import Tenant, Network, Router @@ -18,49 +19,88 @@ def get_networks_and_routers(self, user, cloud_id, tenants): neutron = self.get_client_instance() discovery_result = [] - with transaction.atomic(): - Tenant.objects.filter(cloud_id=cloud_id).delete() + discovery_datetime = timezone.now() + Tenant.objects.filter(cloud_id=cloud_id).update(is_dirty=False) for tenant in tenants: - tenant_obj = Tenant() + tenant_obj = None + try: + tenant_obj = Tenant.objects.filter(tenant_name=tenant.name).get() + except Tenant.DoesNotExist: + tenant_obj = Tenant() tenant_obj.cloud_id = cloud_id tenant_obj.tenant_id = tenant.id tenant_obj.tenant_name = tenant.name tenant_obj.description = tenant.description tenant_obj.enabled = tenant.enabled tenant_obj.creator = user + tenant_obj.is_dirty = True + tenant_obj.updated_on = discovery_datetime tenant_obj.save() - # ToDo: Need to update status, vlan, network_cidr - networks_list = [] + # Setting all records belongs to tenant as not dirty/updated + Network.objects.filter(tenant__tenant_id=tenant.id)\ + .update(is_dirty=False) networks = neutron.list_networks(tenant_id=tenant.id) for network in networks.get("networks", []): - network_obj = Network() + network_obj = None + try: + filters = { + "tenant__tenant_id": tenant.id, + "network_name": network.get("name") + } + network_obj = Network.objects.filter(**filters).get() + except Network.DoesNotExist: + network_obj = Network() network_obj.tenant = tenant_obj + network_obj.network_id = network.get("id") network_obj.network_name = network.get("name") + network_obj.shared = network.get("shared") # ToDo: We are assuming that each network is having only one subnet # ToDo: Need to handle the scenario if we add more than one subnet for a network if network.get("subnets"): subnet_list = neutron.list_subnets(id=network.get("subnets")) network_obj.network_cidr = subnet_list.get("subnets")[0].get("cidr") network_obj.status = network.get("status") + network_obj.is_dirty = True network_obj.creator = user - networks_list.append(network_obj) - Network.objects.bulk_create(networks_list) + network_obj.updated_on = discovery_datetime + network_obj.save() + # Deleting networks which are not got changed after discovery + Network.objects.filter(tenant__tenant_id=tenant_obj.id)\ + .filter(is_dirty=False).delete() - # ToDo: Need to update status - routers_list = [] + # Setting all records belongs to tenant as not dirty/updated + Router.objects.filter(tenant__tenant_id=tenant.id)\ + .update(is_dirty=False) routers = neutron.list_routers(tenant_id=tenant.id) for router in routers.get("routers", []): - router_obj = Router() + router_obj = None + try: + filters = { + "tenant__tenant_id": tenant.id, + "router_name": router.get("name") + } + router_obj = Router.objects.filter(**filters).get() + except Router.DoesNotExist: + router_obj = Router() + router_obj.created_on = discovery_datetime router_obj.tenant = tenant_obj router_obj.router_id = router.get("id") router_obj.router_name = router.get("name") router_obj.status = router.get("status") + router_obj.is_dirty = True router_obj.creator = user - routers_list.append(router_obj) - Router.objects.bulk_create(routers_list) + router_obj.updated_on = discovery_datetime + router_obj.save() + # Deleting routers which are got changed after discovery + Router.objects.filter(tenant__tenant_id=tenant_obj.id)\ + .filter(is_dirty=False).delete() + + # Deleting tenants which are got changed after discovery + Tenant.objects.filter(cloud_id=cloud_id)\ + .filter(is_dirty=False).delete() serializer = TenantSerializer(tenant_obj) discovery_result.append(serializer.data) diff --git a/ntt_tool/apps/cloud/views.py b/ntt_tool/apps/cloud/views.py index e54932f..74be7fb 100644 --- a/ntt_tool/apps/cloud/views.py +++ b/ntt_tool/apps/cloud/views.py @@ -6,6 +6,7 @@ from rest_framework_jwt.authentication import JSONWebTokenAuthentication from models import * from serializers import * +from scripts.novaclientutils import NovaClientUtils from scripts.tenantnetworkdiscovery import TenantDiscovery, NetworkRouterDiscovery @@ -115,6 +116,33 @@ def perform_create(self, serializer): cloud_id=self.request.data.get("cloud_id") ) + @detail_route(methods=["get"], url_path="vm/launch") + def launch_vm(self, request, pk=None): + traffic = None + try: + traffic = Traffic.objects.get(pk=pk) + except Cloud.DoesNotExist: + return Response(status=status.HTTP_404_NOT_FOUND) + + credentials = { + "username": traffic.cloud.keystone_user, + "api_key": traffic.cloud.keystone_password, + "auth_url": traffic.cloud.keystone_auth_url, + "project_id": traffic.cloud.keystone_tenant_name + } + nova = NovaClientUtils(**credentials) + + instances = [] + for tenant in traffic.tenants.all(): + for count, network in enumerate(tenant.networks.all()): + if not network.shared: + vm_name = "-".join([network.network_name, "vm", str(count)]) + instance = nova.launch_vm(tenant.tenant_id, + network.network_id, + vm_name) + instances.append(instance) + return Response(instances) + @detail_route(methods=["get"], url_path="test") def test(self, request, pk=None): return Response("hey") \ No newline at end of file diff --git a/ntt_tool/settings.py b/ntt_tool/settings.py index da11487..e6ba8c7 100644 --- a/ntt_tool/settings.py +++ b/ntt_tool/settings.py @@ -127,8 +127,9 @@ STATIC_URL = '/static/' STATICFILES_DIRS = [ - os.path.join(BASE_DIR, "ntt_tool/static") + os.path.join(BASE_DIR, os.path.join("ntt_tool", "static")) ] +MEDIA_ROOT = os.path.join(BASE_DIR, os.path.join("ntt_tool", "media")) REST_FRAMEWORK = { # Use Django's standard `django.contrib.auth` permissions, diff --git a/ntt_tool/static/js/apps/controllers/cloudcontroller.js b/ntt_tool/static/js/apps/controllers/cloudcontroller.js index 40e2ded..431ecc6 100644 --- a/ntt_tool/static/js/apps/controllers/cloudcontroller.js +++ b/ntt_tool/static/js/apps/controllers/cloudcontroller.js @@ -27,57 +27,34 @@ nttApp.controller('CloudCtrl', function($scope, $routeParams, $location, cloudSe cloudService.get($scope.id).then(function(data){ $scope.cloud = data; }); - }; + } $scope.save = function(){ - cloudService.create($scope.cloud).then(function(data){ - $location.path("cloud/view/" + data.id + "/"); - }); + if ($scope.event == "add") { + cloudService.create($scope.cloud).then(function (response) { + $location.path("cloud/view/" + response.id + "/"); + }); + } + else { + cloudService.update($scope.cloud.id, $scope.cloud).then(function(response){ + $location.path("cloud/view/" + response.id + "/"); + }); + } }; -}); - - - - -//nttApp.controller('CloudCtrl', function($scope, $routeParams, $location, cloudService, cloudTrafficService){ -// $scope.cloudId = $routeParams.cloudId; -// $scope.event = $routeParams.event; -// $scope.cloud = {}; -// $scope.cloudTrafficList = []; -// -// if ($scope.cloudId != undefined){ -// cloudService.get($scope.cloudId).then(function(data){ -// $scope.cloud = data; -// }); -// -// cloudTrafficService.list($scope.cloudId).then(function (data) { -// $scope.cloudTrafficList = data; -// }) -// }; -// -// $scope.save = function(){ -// if ($scope.event == 'add'){ -// cloudService.create($scope.cloud).then(function (data) { -// $location.path("cloudtraffic/add/"+ data.id +"/"); -// }); -// } -// else { -// cloudService.update($scope.cloud.id, $scope.cloud).then(function(data){ -// $location.path("cloud/"+$scope.cloud.id+"/"); -// }); -// }; -// -// }; -// -// $scope.deleteTraffic = function($index){ -// if(confirm("Are you sure want to delete?")) { -// cloudTrafficService.delete($scope.cloudTrafficList[$index].id).then(function (data) { -// $scope.cloudTrafficList.splice($index, 1); -// }); -// } -// } -//}); + $scope.saveAndDiscover = function(){ + if ($scope.event == "add") { + cloudService.create($scope.cloud).then(function(response){ + $location.path("/cloud/tenant/discovery/" + response.id + "/"); + }); + } + else { + cloudService.update($scope.cloud.id, $scope.cloud).then(function(response){ + $location.path("/cloud/tenant/discovery/" + response.id + "/"); + }); + } + } +}); diff --git a/ntt_tool/static/js/apps/controllers/trafficcontroller.js b/ntt_tool/static/js/apps/controllers/trafficcontroller.js index 18282f0..1ef8373 100644 --- a/ntt_tool/static/js/apps/controllers/trafficcontroller.js +++ b/ntt_tool/static/js/apps/controllers/trafficcontroller.js @@ -98,8 +98,12 @@ nttApp.controller('TrafficTestCtrl', function ($scope, $routeParams, trafficServ $scope.cloudId = $routeParams.cloudId; $scope.showLoading = true; $scope.testResult = {}; + $scope.vmLaunchStatus = []; - trafficService.test($scope.id).then(function(response){ - console.log(response); + $scope.status = "Launching VM(s) on selected networks"; + trafficService.launchVM($scope.id).then(function(response){ + $scope.status = "Successfully launched VM(s) on selected networks" + $scope.showLoading = false; + $scope.vmLaunchStatus = response; }); }); \ No newline at end of file diff --git a/ntt_tool/static/js/apps/services/trafficservice.js b/ntt_tool/static/js/apps/services/trafficservice.js index 4f9eb0e..d6a73a0 100644 --- a/ntt_tool/static/js/apps/services/trafficservice.js +++ b/ntt_tool/static/js/apps/services/trafficservice.js @@ -19,9 +19,13 @@ nttApp.service('trafficService', function(dataService){ return dataService.delete('/api/traffic/'+pk+'/'); }; + this.launchVM = function(pk){ + return dataService.get('/api/traffic/' + pk + '/vm/launch/'); + }; + this.test = function(pk){ return dataService.get('/api/traffic/' + pk + '/test/'); - } + }; }); diff --git a/ntt_tool/static/partials/cloud/cloud_form.html b/ntt_tool/static/partials/cloud/cloud_form.html index 5c2a715..97d5205 100644 --- a/ntt_tool/static/partials/cloud/cloud_form.html +++ b/ntt_tool/static/partials/cloud/cloud_form.html @@ -37,7 +37,7 @@

{$ event | capitalize:true $} Cloud

Cancel - +
diff --git a/ntt_tool/static/partials/cloud/tenants/tenants_list.html b/ntt_tool/static/partials/cloud/tenants/tenants_list.html index 937a617..401473c 100644 --- a/ntt_tool/static/partials/cloud/tenants/tenants_list.html +++ b/ntt_tool/static/partials/cloud/tenants/tenants_list.html @@ -7,11 +7,15 @@

Tenants

- + - +
Tenant NameEnabledStatus
{$ item.tenant_name $}{$ item.enabled $} + + {$ item.enabled === true ? "Enabled" : "Disabled" $} + +
diff --git a/ntt_tool/static/partials/cloud/traffic/traffic_form.html b/ntt_tool/static/partials/cloud/traffic/traffic_form.html index 7abe2b6..d9d16a4 100644 --- a/ntt_tool/static/partials/cloud/traffic/traffic_form.html +++ b/ntt_tool/static/partials/cloud/traffic/traffic_form.html @@ -116,12 +116,16 @@

{$ event | capitalize:true $} Traffic

- + - +
Tenant NameEnabledStatus
{$ tenant.tenant_name $}{$ tenant.enabled $} + + {$ item.enabled === true ? "Enabled" : "Disabled" $} + +
@@ -138,12 +142,16 @@

{$ event | capitalize:true $} Traffic

Tenant Name - Enabled + Status {$ tenant.tenant_name $} - {$ tenant.enabled $} + + + {$ item.enabled === true ? "Enabled" : "Disabled" $} + +
diff --git a/ntt_tool/static/partials/cloud/traffic/traffic_list.html b/ntt_tool/static/partials/cloud/traffic/traffic_list.html index a998b04..84c7abc 100644 --- a/ntt_tool/static/partials/cloud/traffic/traffic_list.html +++ b/ntt_tool/static/partials/cloud/traffic/traffic_list.html @@ -18,12 +18,12 @@

Traffic

{$ cloudTraffic.name $} - {$ cloudTraffic.allowed_delta_percentage $} % + {$ cloudTraffic.allowed_delta_percentage $}% {$ cloudTraffic.test_result_path $} {$ cloudTraffic.number_of_workers $} {$ cloudTraffic.remote_user $} {$ cloudTraffic.test_method $} - {$ cloudTraffic.iperf_duration $} sec + {$ cloudTraffic.iperf_duration $}sec {$ cloudTraffic.tenant_type $} diff --git a/ntt_tool/static/partials/cloud/traffic/traffic_test.html b/ntt_tool/static/partials/cloud/traffic/traffic_test.html index 4f07059..7c053f9 100644 --- a/ntt_tool/static/partials/cloud/traffic/traffic_test.html +++ b/ntt_tool/static/partials/cloud/traffic/traffic_test.html @@ -16,9 +16,33 @@ -
-
+
+
+ +
+
+
+

{$ status $}

+
+
+
+
+ +
+
{$ status $}
+ + + + + + + + + +
VM NameVM Status
{$ instance.instance_name $}{$ instance.instance_status $}
+ +
\ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 26906c3..1526d0e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,9 @@ djangorestframework==3.3.2 djangorestframework-jwt==1.7.2 six==1.10.0 wsgiref==0.1.2 - +python-heatclient==0.6.0 python-keystoneclient==1.6.0 python-neutronclient==2.6.0 +python-novaclient==2.17.0 +python-swiftclient==2.4.0 +python-glanceclient==2.0.0 \ No newline at end of file From 41c3621479b404628dce01ec8cd01908b853801c Mon Sep 17 00:00:00 2001 From: Abdul Gaffar Date: Mon, 21 Mar 2016 16:16:49 +0530 Subject: [PATCH 19/57] Added ubuntu image --- .gitattributes | 1 + ntt_tool/media/osimages/ubuntu.img | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 .gitattributes create mode 100644 ntt_tool/media/osimages/ubuntu.img diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..5713ac7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.img filter=lfs diff=lfs merge=lfs -text diff --git a/ntt_tool/media/osimages/ubuntu.img b/ntt_tool/media/osimages/ubuntu.img new file mode 100644 index 0000000..4264222 --- /dev/null +++ b/ntt_tool/media/osimages/ubuntu.img @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:32d142beddf51b7439eebb319b9185458e9823f75355bf9b60531186e8030657 +size 259260928 From 8e6f011142c006803e2ba188aaa3ebdc3aa6ce13 Mon Sep 17 00:00:00 2001 From: Abdul Gaffar Date: Mon, 21 Mar 2016 16:45:41 +0530 Subject: [PATCH 20/57] renamed scripts folder --- .../{scripts => openstackscripts}/__init__.py | 0 .../apps/cloud/openstackscripts/config.py | 29 ++++++ .../openstackscripts/glanceclientutils.py | 19 ++++ .../keystoneclientutils.py | 0 .../neutronclientutils.py | 0 .../cloud/openstackscripts/novaclientutils.py | 95 +++++++++++++++++++ .../openstackclientutils.py | 0 .../openstackscripts/openstackcredentials.py | 0 .../tenantnetworkdiscovery.py | 0 ntt_tool/apps/cloud/openstackscripts/user.txt | 7 ++ .../apps/cloud/openstackscripts/vmmanager.py | 11 +++ ntt_tool/apps/cloud/views.py | 4 +- 12 files changed, 163 insertions(+), 2 deletions(-) rename ntt_tool/apps/cloud/{scripts => openstackscripts}/__init__.py (100%) create mode 100644 ntt_tool/apps/cloud/openstackscripts/config.py create mode 100644 ntt_tool/apps/cloud/openstackscripts/glanceclientutils.py rename ntt_tool/apps/cloud/{scripts => openstackscripts}/keystoneclientutils.py (100%) rename ntt_tool/apps/cloud/{scripts => openstackscripts}/neutronclientutils.py (100%) create mode 100644 ntt_tool/apps/cloud/openstackscripts/novaclientutils.py rename ntt_tool/apps/cloud/{scripts => openstackscripts}/openstackclientutils.py (100%) create mode 100644 ntt_tool/apps/cloud/openstackscripts/openstackcredentials.py rename ntt_tool/apps/cloud/{scripts => openstackscripts}/tenantnetworkdiscovery.py (100%) create mode 100644 ntt_tool/apps/cloud/openstackscripts/user.txt create mode 100644 ntt_tool/apps/cloud/openstackscripts/vmmanager.py diff --git a/ntt_tool/apps/cloud/scripts/__init__.py b/ntt_tool/apps/cloud/openstackscripts/__init__.py similarity index 100% rename from ntt_tool/apps/cloud/scripts/__init__.py rename to ntt_tool/apps/cloud/openstackscripts/__init__.py diff --git a/ntt_tool/apps/cloud/openstackscripts/config.py b/ntt_tool/apps/cloud/openstackscripts/config.py new file mode 100644 index 0000000..2ad1591 --- /dev/null +++ b/ntt_tool/apps/cloud/openstackscripts/config.py @@ -0,0 +1,29 @@ +import os +from django.conf import settings + +# NOVA CONFIGS +NOVA_FLOATING_IP_CREATION = True +NOVA_FLOATING_IP_POOL = 'public' + +NOVA_IMAGE_NAME = "ubuntu" + +NOVA_QUOTA_INSTANCES = -1 +NOVA_QUOTA_CORES = -1 +NOVA_QUOTA_RAM = -1 +NOVA_QUOTA_FIXED_IPS = -1 +NOVA_QUOTA_FLOATING_IPS = -1 + +NOVA_VM_FLAVOR = "traffic" +NOVA_VM_FLAVOR_RAM = 2048 # In Mega Bytes +NOVA_VM_FLAVOR_VCPUS = 1 +NOVA_VM_FLAVOR_DISK = 10 # In Giga Bytes + + +# GLANCE CONFIGS +GLANCE_ENDPOINT = "http://172.168.2.40:9292" + +GLANCE_IMAGE_NAME = NOVA_IMAGE_NAME +GLANCE_IMAGE_PATH = os.path.join(settings.MEDIA_ROOT, os.path.join("osimages", "ubuntu.img")) +GLANCE_IMAGE_DISK_FORMAT = "qcow2" +GLANCE_IMAGE_CONTAINER_FORMAT = "bare" + diff --git a/ntt_tool/apps/cloud/openstackscripts/glanceclientutils.py b/ntt_tool/apps/cloud/openstackscripts/glanceclientutils.py new file mode 100644 index 0000000..0962340 --- /dev/null +++ b/ntt_tool/apps/cloud/openstackscripts/glanceclientutils.py @@ -0,0 +1,19 @@ +from glanceclient.v2 import client as glance_client +from openstackclientutils import OpenStackClientUtils +from config import * + + +class GlanceClientUtils(OpenStackClientUtils): + client_class = glance_client.Client + + def __init__(self, **credentials): + super(GlanceClientUtils, self).__init__(**credentials) + self.glance = self.get_client_instance() + + def upload_image(self): + image = self.glance.images.create( + disk_format=GLANCE_IMAGE_DISK_FORMAT, + container_format=GLANCE_IMAGE_CONTAINER_FORMAT, + name=GLANCE_IMAGE_NAME) + self.glance.images.upload(image.id, open(GLANCE_IMAGE_PATH, 'rb')) + return image diff --git a/ntt_tool/apps/cloud/scripts/keystoneclientutils.py b/ntt_tool/apps/cloud/openstackscripts/keystoneclientutils.py similarity index 100% rename from ntt_tool/apps/cloud/scripts/keystoneclientutils.py rename to ntt_tool/apps/cloud/openstackscripts/keystoneclientutils.py diff --git a/ntt_tool/apps/cloud/scripts/neutronclientutils.py b/ntt_tool/apps/cloud/openstackscripts/neutronclientutils.py similarity index 100% rename from ntt_tool/apps/cloud/scripts/neutronclientutils.py rename to ntt_tool/apps/cloud/openstackscripts/neutronclientutils.py diff --git a/ntt_tool/apps/cloud/openstackscripts/novaclientutils.py b/ntt_tool/apps/cloud/openstackscripts/novaclientutils.py new file mode 100644 index 0000000..05ac6a7 --- /dev/null +++ b/ntt_tool/apps/cloud/openstackscripts/novaclientutils.py @@ -0,0 +1,95 @@ +import time +import os +from novaclient.v1_1 import client as nova_client +from novaclient.exceptions import NotFound +from openstackclientutils import OpenStackClientUtils +from keystoneclientutils import KeystoneClientUtils +from glanceclientutils import GlanceClientUtils +from config import * + + +class NovaClientUtils(OpenStackClientUtils): + client_class = nova_client.Client + + def __init__(self, **credentials): + super(NovaClientUtils, self).__init__(**credentials) + self.nova = self.get_client_instance() + + def assign_floating_ip(self, instance): + if NOVA_FLOATING_IP_CREATION: + floating_ip = self.nova.floating_ips.create(NOVA_FLOATING_IP_POOL) + instance.add_floating_ip(floating_ip) + return True + return False + + def launch_vm(self, tenant_id, network_id, vm_name): + """ + Launches VM on given tenant and network + :param tenant_id: + :param network_id: + :param vm_name: + :return: VM instance + """ + self.nova.quotas.update(tenant_id, + instances=NOVA_QUOTA_INSTANCES, + cores=NOVA_QUOTA_CORES, + ram=NOVA_QUOTA_RAM, + fixed_ips=NOVA_QUOTA_FIXED_IPS, + floating_ips=NOVA_QUOTA_FLOATING_IPS) + + user_data = None + user_data_file_path = os.path.join(os.path.dirname(__file__), 'user.txt') + with open(user_data_file_path, 'r') as f: + user_data = f.read() + + image = None + try: + image = self.nova.images.find(name=NOVA_IMAGE_NAME) + except NotFound: + # Uploading image if does not exist. + keystone_credentials = { + "username": self.credentials.get("username"), + "password": self.credentials.get("api_key"), + "auth_url": self.credentials.get("auth_url"), + "tenant_name": self.credentials.get("project_id") + } + keystone = KeystoneClientUtils(**keystone_credentials) + glance = GlanceClientUtils(endpoint=GLANCE_ENDPOINT, + token=keystone.get_token()) + image = glance.upload_image() + + # Creating flavor + flavor = None + try: + flavor = self.nova.flavors.find(name=NOVA_VM_FLAVOR) + except NotFound: + flavor = self.nova.flavors.create(name=NOVA_VM_FLAVOR, + ram=NOVA_VM_FLAVOR_RAM, + vcpus=NOVA_VM_FLAVOR_VCPUS, + disk=NOVA_VM_FLAVOR_DISK) + # Launching VM + instance = self.nova.servers.create(name=vm_name, + image=image, + flavor=flavor, + key_name="admin", + nics=[{'net-id': network_id}], + userdata=user_data) + + # Waiting and querying instance till instance status becomes active + while instance.status == 'BUILD': + time.sleep(10) + instance = self.nova.servers.get(instance.id) + + # Assigning floating IP to the instance + self.assign_floating_ip(instance) + + return { + "instance_name": vm_name, + "instance_status": instance.status + } + + + + + + diff --git a/ntt_tool/apps/cloud/scripts/openstackclientutils.py b/ntt_tool/apps/cloud/openstackscripts/openstackclientutils.py similarity index 100% rename from ntt_tool/apps/cloud/scripts/openstackclientutils.py rename to ntt_tool/apps/cloud/openstackscripts/openstackclientutils.py diff --git a/ntt_tool/apps/cloud/openstackscripts/openstackcredentials.py b/ntt_tool/apps/cloud/openstackscripts/openstackcredentials.py new file mode 100644 index 0000000..e69de29 diff --git a/ntt_tool/apps/cloud/scripts/tenantnetworkdiscovery.py b/ntt_tool/apps/cloud/openstackscripts/tenantnetworkdiscovery.py similarity index 100% rename from ntt_tool/apps/cloud/scripts/tenantnetworkdiscovery.py rename to ntt_tool/apps/cloud/openstackscripts/tenantnetworkdiscovery.py diff --git a/ntt_tool/apps/cloud/openstackscripts/user.txt b/ntt_tool/apps/cloud/openstackscripts/user.txt new file mode 100644 index 0000000..294cbc2 --- /dev/null +++ b/ntt_tool/apps/cloud/openstackscripts/user.txt @@ -0,0 +1,7 @@ +#cloud-config +chpasswd: + list: | + root:ubuntu + ubuntu:ubuntu + expire: False +ssh_pwauth: True \ No newline at end of file diff --git a/ntt_tool/apps/cloud/openstackscripts/vmmanager.py b/ntt_tool/apps/cloud/openstackscripts/vmmanager.py new file mode 100644 index 0000000..e62d60a --- /dev/null +++ b/ntt_tool/apps/cloud/openstackscripts/vmmanager.py @@ -0,0 +1,11 @@ +from novaclientutils import NovaClientUtils +from glanceclientutils import GlanceClientUtils + + +class VMManager(NovaClientUtils, GlanceClientUtils): + + def check_status(self): + pass + + def destroy(self, vm_id=None): + pass diff --git a/ntt_tool/apps/cloud/views.py b/ntt_tool/apps/cloud/views.py index 74be7fb..0ea7d85 100644 --- a/ntt_tool/apps/cloud/views.py +++ b/ntt_tool/apps/cloud/views.py @@ -6,8 +6,8 @@ from rest_framework_jwt.authentication import JSONWebTokenAuthentication from models import * from serializers import * -from scripts.novaclientutils import NovaClientUtils -from scripts.tenantnetworkdiscovery import TenantDiscovery, NetworkRouterDiscovery +from openstackscripts.novaclientutils import NovaClientUtils +from openstackscripts.tenantnetworkdiscovery import TenantDiscovery, NetworkRouterDiscovery class CloudViewSet(viewsets.ModelViewSet): From 14bf998bc794b573f6fee7bf2f6111fc2ab3b082 Mon Sep 17 00:00:00 2001 From: Abdul Gaffar Date: Mon, 21 Mar 2016 16:55:50 +0530 Subject: [PATCH 21/57] Fixed typo --- ntt_tool/static/partials/cloud/traffic/traffic_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntt_tool/static/partials/cloud/traffic/traffic_form.html b/ntt_tool/static/partials/cloud/traffic/traffic_form.html index d9d16a4..dc0457e 100644 --- a/ntt_tool/static/partials/cloud/traffic/traffic_form.html +++ b/ntt_tool/static/partials/cloud/traffic/traffic_form.html @@ -149,7 +149,7 @@

{$ event | capitalize:true $} Traffic

{$ tenant.tenant_name $} - {$ item.enabled === true ? "Enabled" : "Disabled" $} + {$ tenant.enabled === true ? "Enabled" : "Disabled" $} From a5d7cd80228287b34cb2219ed2b77776422c5b58 Mon Sep 17 00:00:00 2001 From: Abdul Gaffar Date: Mon, 21 Mar 2016 16:57:13 +0530 Subject: [PATCH 22/57] Fixed typo --- ntt_tool/static/partials/cloud/traffic/traffic_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntt_tool/static/partials/cloud/traffic/traffic_form.html b/ntt_tool/static/partials/cloud/traffic/traffic_form.html index dc0457e..7b56b15 100644 --- a/ntt_tool/static/partials/cloud/traffic/traffic_form.html +++ b/ntt_tool/static/partials/cloud/traffic/traffic_form.html @@ -123,7 +123,7 @@

{$ event | capitalize:true $} Traffic

{$ tenant.tenant_name $} - {$ item.enabled === true ? "Enabled" : "Disabled" $} + {$ tenant.enabled === true ? "Enabled" : "Disabled" $} From 5aedb7b62e01ed73ebbb1175256c9e6523999894 Mon Sep 17 00:00:00 2001 From: Abdul Gaffar Date: Thu, 24 Mar 2016 16:08:35 +0530 Subject: [PATCH 23/57] Tenant discovery design revamp --- .idea/workspace.xml | 439 ++++++++---------- ntt_tool/.gitignore | 1 - ntt_tool/static/css/custom.css | 5 + ntt_tool/static/js/apps/app.js | 7 +- .../js/apps/controllers/cloudcontroller.js | 24 +- .../js/apps/controllers/tenantcontroller.js | 28 +- .../static/js/apps/directives/directives.js | 3 + .../static/partials/cloud/cloud_form.html | 2 +- .../cloud/tenants/tenants_discovery.html | 122 +++-- .../partials/cloud/tenants/tenants_list.html | 17 +- ntt_tool/templates/base.html | 1 + 11 files changed, 303 insertions(+), 346 deletions(-) create mode 100644 ntt_tool/static/js/apps/directives/directives.js diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 8bf6aa1..762a9a5 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,15 +2,17 @@ - - - - + - - - - + + + + + + + + + @@ -48,73 +50,61 @@ - - + + - - + + - - + + - - - - - - - - - - - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -127,8 +117,8 @@ @@ -138,9 +128,6 @@ @@ -199,9 +189,9 @@ @@ -228,7 +218,6 @@ - @@ -243,7 +232,7 @@ @@ -253,7 +242,7 @@ + @@ -644,6 +574,10 @@ + + + + @@ -651,10 +585,6 @@ - - - - @@ -923,27 +853,27 @@ - + - - + + - - + + @@ -961,9 +891,9 @@ - - + + @@ -995,21 +925,6 @@ - - - - - - - - - - - - - - - @@ -1024,13 +939,6 @@ - - - - - - - @@ -1109,13 +1017,6 @@ - - - - - - - @@ -1130,21 +1031,6 @@ - - - - - - - - - - - - - - - @@ -1152,13 +1038,6 @@ - - - - - - - @@ -1177,7 +1056,6 @@ - @@ -1185,11 +1063,10 @@ - - + @@ -1200,7 +1077,6 @@ - @@ -1208,18 +1084,17 @@ - - + - + @@ -1233,144 +1108,196 @@ - + - + - + - - - + + - + - - + + - + - - + + + + + + + + + - + - - + + - + - - + + - + - + - + - - + - + - - + - + - + - + - - + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + - + - + + + + + + + + + - + - + - + - + - - - - - + + + - + - - + + - + + + + + + + + + + + + + + + + + - - + + diff --git a/ntt_tool/.gitignore b/ntt_tool/.gitignore index 2befe9f..e7c5e4b 100644 --- a/ntt_tool/.gitignore +++ b/ntt_tool/.gitignore @@ -130,4 +130,3 @@ atlassian-ide-plugin.xml com_crashlytics_export_strings.xml crashlytics.properties crashlytics-build.properties - diff --git a/ntt_tool/static/css/custom.css b/ntt_tool/static/css/custom.css index f459e94..8ffb353 100644 --- a/ntt_tool/static/css/custom.css +++ b/ntt_tool/static/css/custom.css @@ -110,6 +110,11 @@ td > a{ border: 1px solid #ddd; } +.modal-body { + max-height: calc(100vh - 210px); + overflow-y: auto; +} + /* widgets */ .card { border-radius: 2px; diff --git a/ntt_tool/static/js/apps/app.js b/ntt_tool/static/js/apps/app.js index 063b905..ae0b99c 100644 --- a/ntt_tool/static/js/apps/app.js +++ b/ntt_tool/static/js/apps/app.js @@ -81,9 +81,14 @@ nttApp.config(['$routeProvider', function($routeProvider){ controller: 'TrafficTestCtrl', templateUrl: '/static/partials/cloud/traffic/traffic_test.html' }); +}]); + + + + + -}]); diff --git a/ntt_tool/static/js/apps/controllers/cloudcontroller.js b/ntt_tool/static/js/apps/controllers/cloudcontroller.js index 431ecc6..172e2e5 100644 --- a/ntt_tool/static/js/apps/controllers/cloudcontroller.js +++ b/ntt_tool/static/js/apps/controllers/cloudcontroller.js @@ -42,18 +42,18 @@ nttApp.controller('CloudCtrl', function($scope, $routeParams, $location, cloudSe } }; - $scope.saveAndDiscover = function(){ - if ($scope.event == "add") { - cloudService.create($scope.cloud).then(function(response){ - $location.path("/cloud/tenant/discovery/" + response.id + "/"); - }); - } - else { - cloudService.update($scope.cloud.id, $scope.cloud).then(function(response){ - $location.path("/cloud/tenant/discovery/" + response.id + "/"); - }); - } - } + //$scope.saveAndDiscover = function(){ + // if ($scope.event == "add") { + // cloudService.create($scope.cloud).then(function(response){ + // $location.path("cloud/view/" + response.id + "/").search('discover', 'true'); + // }); + // } + // else { + // cloudService.update($scope.cloud.id, $scope.cloud).then(function(response){ + // $location.path("cloud/view/" + response.id + "/").search('discover', 'true'); + // }); + // } + //} }); diff --git a/ntt_tool/static/js/apps/controllers/tenantcontroller.js b/ntt_tool/static/js/apps/controllers/tenantcontroller.js index 0168e40..a8f6215 100644 --- a/ntt_tool/static/js/apps/controllers/tenantcontroller.js +++ b/ntt_tool/static/js/apps/controllers/tenantcontroller.js @@ -4,18 +4,30 @@ nttApp.controller('TenantListCtrl', function($scope, $routeParams, tenantService tenantService.list($scope.cloudId).then(function(response){ $scope.tenants = response; }); -}); - -nttApp.controller('TenantDiscoveryCtrl', function($scope, $routeParams, tenantService){ - $scope.cloudId = $routeParams.cloudId; - $scope.discoveryResult = {}; $scope.showLoading = true; $scope.discover = function(){ + $scope.showLoading = true; tenantService.discover($scope.cloudId).then(function(response){ $scope.showLoading = false; - $scope.discoveryResult = response; + $scope.tenants = response; }); }; - $scope.discover(); -}); \ No newline at end of file +}); + +//nttApp.controller('TenantDiscoveryCtrl', function($scope, $routeParams, tenantService){ +// console.log($routeParams) +// $scope.cloudId = $routeParams.id; +// $scope.discoveryResult = {}; +// console.log("1") +// $scope.showLoading = true; +// $scope.discover = function(){ +// console.log("2") +// tenantService.discover($scope.cloudId).then(function(response){ +// console.log("3") +// $scope.showLoading = false; +// $scope.discoveryResult = response; +// }); +// }; +// $scope.discover(); +//}); \ No newline at end of file diff --git a/ntt_tool/static/js/apps/directives/directives.js b/ntt_tool/static/js/apps/directives/directives.js new file mode 100644 index 0000000..2a548e4 --- /dev/null +++ b/ntt_tool/static/js/apps/directives/directives.js @@ -0,0 +1,3 @@ +/** + * Created by abdul on 24/3/16. + */ diff --git a/ntt_tool/static/partials/cloud/cloud_form.html b/ntt_tool/static/partials/cloud/cloud_form.html index 97d5205..2f151b6 100644 --- a/ntt_tool/static/partials/cloud/cloud_form.html +++ b/ntt_tool/static/partials/cloud/cloud_form.html @@ -37,7 +37,7 @@

{$ event | capitalize:true $} Cloud

Cancel - + diff --git a/ntt_tool/static/partials/cloud/tenants/tenants_discovery.html b/ntt_tool/static/partials/cloud/tenants/tenants_discovery.html index 3afd710..5e3b074 100644 --- a/ntt_tool/static/partials/cloud/tenants/tenants_discovery.html +++ b/ntt_tool/static/partials/cloud/tenants/tenants_discovery.html @@ -1,75 +1,71 @@ - - -
-
-
- -
-
- -
-
- -
-
+ +