Commit 66b16ba6 by Cheng-En Wu

Initial commit

parents
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="FacetManager">
<facet type="django" name="Django">
<configuration>
<option name="rootFolder" value="$MODULE_DIR$" />
<option name="settingsModule" value="auto_istio/settings.py" />
<option name="manageScript" value="$MODULE_DIR$/manage.py" />
<option name="environment" value="&lt;map/&gt;" />
<option name="doNotUseTestRunner" value="false" />
<option name="trackFilePattern" value="migrations" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Remote Python 3.6.9 (sftp://ubuntu@10.0.0.210:22/usr/bin/python3)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_CONFIGURATION" value="Django" />
<option name="TEMPLATE_FOLDERS">
<list>
<option value="$MODULE_DIR$/../auto_istio\templates" />
</list>
</option>
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData" autoUpload="Always" serverName="ubuntu@10.0.0.210:22" autoUploadExternalChanges="true">
<serverData>
<paths name="10.0.0.210">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
<paths name="10.0.0.232">
<serverdata>
<mappings>
<mapping deploy="/home/ubuntu/auto_istio" local="$PROJECT_DIR$" />
</mappings>
</serverdata>
</paths>
<paths name="Copy of project-level server '10.0.0.210'">
<serverdata>
<mappings>
<mapping deploy="/home/ubuntu/auto_istio" local="$PROJECT_DIR$" />
</mappings>
</serverdata>
</paths>
<paths name="ubuntu@10.0.0.210:22">
<serverdata>
<mappings>
<mapping deploy="/home/ubuntu/auto_istio" local="$PROJECT_DIR$" />
</mappings>
</serverdata>
</paths>
</serverData>
<option name="myAutoUpload" value="ALWAYS" />
</component>
</project>
\ No newline at end of file
<component name="ProjectDictionaryState">
<dictionary name="Administrator">
<words>
<w>istio</w>
</words>
</dictionary>
</component>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Remote Python 3.6.9 (sftp://ubuntu@10.0.0.210:22/usr/bin/python3)" project-jdk-type="Python SDK" />
<component name="PyPackaging">
<option name="earlyReleasesAsUpgrades" value="true" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/auto_istio.iml" filepath="$PROJECT_DIR$/.idea/auto_istio.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteMappingsManager">
<list>
<list>
<remote-mappings server-id="python@63bd365f-7ccb-473e-87f1-c1520a0bafb1" />
</list>
</list>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SshConfigs">
<configs>
<sshConfig host="10.0.0.210" id="f2d64377-7ace-4838-ac83-7f66af570ffa" keyPath="C:\Users\Administrator\.ssh\id_rsa" port="22" customName="10.0.0.210" nameFormat="CUSTOM" />
<sshConfig host="10.0.0.210" id="8e8098ea-dd0e-4eff-a2c2-8ce799e84bba" keyPath="C:\Users\Administrator\.ssh\id_rsa" port="22" customName="10.0.0.210" nameFormat="CUSTOM" />
<sshConfig host="10.0.0.210" id="b714a8dd-91af-42b8-8492-836471e31607" keyPath="C:\Users\Administrator\.ssh\id_rsa" port="22" customName="10.0.0.210" nameFormat="CUSTOM" />
<sshConfig host="10.0.0.210" id="2ac788c2-67d4-4d20-ac53-415d08ce1542" keyPath="C:\Users\Administrator\.ssh\id_rsa" port="22" customName="10.0.0.210" nameFormat="CUSTOM" />
<sshConfig host="10.0.0.210" id="9471231d-b032-4b54-b64d-bb2ad6fba4cc" keyPath="C:\Users\Administrator\.ssh\id_rsa" port="22" customName="10.0.0.210" nameFormat="CUSTOM" />
<sshConfig host="10.0.0.210" id="bef5254c-7c4b-4edb-90ac-a41f04b0c4a4" keyPath="C:\Users\Administrator\.ssh\id_rsa" port="22" customName="10.0.0.210" nameFormat="CUSTOM" />
<sshConfig host="10.0.0.210" id="f1bb479e-0d00-446b-b914-b5c9efc77162" keyPath="C:\Users\Administrator\.ssh\id_rsa" port="22" customName="10.0.0.210" nameFormat="CUSTOM" />
<sshConfig host="10.0.0.210" id="2caf8e1f-253a-460c-8f71-49200d644b85" keyPath="C:\Users\Administrator\.ssh\id_rsa" port="22" customName="10.0.0.210" nameFormat="CUSTOM" />
<sshConfig host="10.0.0.210" id="f8198786-579b-4a3b-a023-6effff7823a1" keyPath="C:\Users\Administrator\.ssh\id_rsa" port="22" customName="10.0.0.210" nameFormat="CUSTOM" />
<sshConfig host="10.0.0.210" id="3cb4b2ba-367b-46a0-84d2-1e74fa89870f" keyPath="C:\Users\Administrator\.ssh\id_rsa" port="22" customName="10.0.0.210" nameFormat="CUSTOM" />
<sshConfig host="10.0.0.210" id="9d47fb10-d0f6-42d0-8e67-d00673795a7a" keyPath="C:\Users\Administrator\.ssh\id_rsa" port="22" customName="10.0.0.210" nameFormat="CUSTOM" />
</configs>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="WebServers">
<option name="servers">
<webServer id="c002f63c-1771-45e0-8b53-606c3605ea1f" name="10.0.0.210" url="http://10.0.0.210">
<fileTransfer host="10.0.0.210" port="22" privateKey="C:\Users\Administrator\.ssh\id_rsa" accessType="SFTP" keyPair="true">
<advancedOptions>
<advancedOptions dataProtectionLevel="Private" passiveMode="true" shareSSLContext="true" />
</advancedOptions>
<option name="port" value="22" />
</fileTransfer>
</webServer>
</option>
</component>
</project>
\ No newline at end of file
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class AppConfig(AppConfig):
name = 'app'
from django.db import models
# Create your models here.
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: name
spec:
host: host
trafficPolicy:
tls:
mode: ISTIO_MUTUAL
connectionPool:
tcp:
maxConnections: 1
http:
http1MaxPendingRequests: 1
maxRequestsPerConnection: 1
outlierDetection:
consecutiveErrors: 1
interval: 1s
baseEjectionTime: 30s
maxEjectionPercent: 100
\ No newline at end of file
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: name
spec:
trafficPolicy:
tls:
mode: ISTIO_MUTUAL
host: host
subsets:
- name: v1
labels:
version: v1
- name: v2
labels:
version: v2
\ No newline at end of file
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: name
spec:
hosts:
- host
http:
- route:
- destination:
host: host
subset: v1
weight: 100
mirror:
host: host
subset: v2
mirror_percent: 100
\ No newline at end of file
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: name
spec:
hosts:
- host
http:
- route:
- destination:
host: host
retries:
attempts: 3
perTryTimeout: 2s
\ No newline at end of file
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: host
spec:
hosts:
- host
http:
- route:
- destination:
host: host
subset: v1
weight: 90
- destination:
host: host
subset: v2
weight: 10
\ No newline at end of file
from django.test import TestCase
# Create your tests here.
eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJkZWZhdWx0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6ImRlZmF1bHQtdG9rZW4tZG5yN2giLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiZGVmYXVsdCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6ImE5N2MwNzI4LWJiNGYtNGE1Yy1hM2RmLThlOWZmZmI5ZGI1ZSIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDpkZWZhdWx0OmRlZmF1bHQifQ.kp5xdj7cqNzGKSY-j1gBitP-Rr_90bz92B_FF91NipPGFE6f9BwQtZD9eYcMCCVnyvthDALO4egh-FJuLle9KT-EdcWsF58LFklBIzbFiSgF4gj5DgXbNhu5P9ykuhng-qJMl21h1yBD6YUHmEB7yU05gOjNgg_4MjaCI4dKo7fPEthaLJygqsXjMksH3af4ss6F2XUGTC9WmB6jdjTAzUR83lzMjoF6I8Lkc5Xzj595iRXL7KZeCLyTD8mR5EcE3weThOSayWNzZHckwgOV-_qp1_o-O6Ujl4Ga7NeNhCZI49jgMSxnkbM4qIavP_FO05nfmbMWUj1UfGy6ilkFoA
\ No newline at end of file
This diff is collapsed. Click to expand it.
"""
Django settings for auto_istio project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'p5y#bacdj*@#lnr5xqa5edpaqo_x17@)%6x2r)0=ff_z9uyixj'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework'
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'auto_istio.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')]
,
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'auto_istio.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Password validation
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/
STATIC_URL = '/static/'
"""auto_istio URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from django.urls import path, include
from app.views import AutoIstioApi
urlpatterns = [
path('admin/', admin.site.urls),
url(r'^api-auth/', include('rest_framework.urls')),
url(r'^istio/circuit_breaking',
AutoIstioApi.as_view({
'post': 'create_circuit_breaking'})),
url(r'^istio/canary_release',
AutoIstioApi.as_view({
'post': 'create_canary_release'})),
url(r'^istio/retries',
AutoIstioApi.as_view({
'post': 'create_retry_policy'}))
]
"""
WSGI config for auto_istio project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'auto_istio.settings')
application = get_wsgi_application()
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'auto_istio.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment