This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test6(): | |
a, b = test7() | |
print a | |
print b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: my-nginx-web-service | |
labels: | |
run: my-nginx-web-service | |
spec: | |
type: NodePort | |
ports: | |
- port: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: cats-deployment | |
spec: | |
replicas: 3 | |
template: | |
metadata: | |
labels: | |
app: cats-deployment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: cats-service | |
labels: | |
run: cats-service | |
spec: | |
type: NodePort | |
ports: | |
- port: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: dogs-deployment | |
spec: | |
replicas: 3 | |
template: | |
metadata: | |
labels: | |
app: dogs-deployment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: dogs-service | |
labels: | |
run: dogs-service | |
spec: | |
type: NodePort | |
ports: | |
- port: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
name: pets-ingress | |
spec: | |
rules: | |
- host: cats.myweb.com | |
http: | |
paths: | |
- backend: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from twilio.rest import TwilioClient | |
call = TwilioClient.calls.create( | |
to="{first_agent_number}", | |
from_={twilio_caller_id}, | |
url=reverse("twiml_dial_second_leg_url") | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TwiMLDialSecondLegView(APIView): | |
""" | |
Read more here: https://www.twilio.com/docs/voice/twiml | |
""" | |
def post(self, request, *args, **kwargs): | |
response = VoiceResponse() | |
action_url = urlparse.urljoin(settings.SITE_URL, reverse('first_leg_disconnected_url')) | |
dial = Dial(action=action_url, caller_id=request.GET.get("caller_id", TwilioClient.get_caller_id())) | |
customer_number = request.GET["customer_number"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def connect_customer_to_conference(cls, customer_call_sid, conference_room): | |
# giving all the parameters needed by the twiml view in query parameters | |
query_params = "?conference_room={0}&end_conference_on_exit=True".format(urllib.quote(conference_room)) | |
# Twilio will hit this url to get the updated TwiML | |
conference_twiml_url = urlparse.urljoin(settings.SITE_URL, reverse('twiml_conference_url')) + query_params | |
cls.client.calls(call_sid).update(method="POST", url=conference_twiml_url) |
OlderNewer