0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

wsadminで設定し、設定できたことを確認する(Cookie編)

Last updated at Posted at 2021-11-20

今回はwsadminで特定の設定を取得する方法
ノードとアプリケーションサーバの情報は別ファイルから呼び出す方法
まずは定義ファイル

jvminfo.txt
yyd1Node01,server1
yyd1Node01,server2
yyd2Node01,server1

Cookieの設定するコード
設定値を変数渡しをしたい場合はこちらのコードを参照してください。
※いつか直します。。。
https://qiita.com/XKYUXSOX/items/7f33c1ee19827030f0a7

"Cookie_set.py
import csv

with open('jvminfo.txt') as f:
    csvreader = csv.reader(f)
    for row in csvreader:
      nodename=row[0]
      servername=row[1]
      id=AdminConfig.getid('/Node:'+nodename+'/Server:'+servername+'/')
      ProcessID = AdminConfig.list('Cookie',id)
      print nodename + servername
      AdminConfig.modify(ProcessID,'[[name "EEJSESSION"]]')
      AdminConfig.modify(ProcessID,'[[secure "true"]]')
      AdminConfig.modify(ProcessID,'[[httpOnly "true"]]')

AdminConfig.save()

Cookieの設定情報を取得するコード

"Cookie_get.py

import csv

with open('jvminfo.txt') as f:
    csvreader = csv.reader(f)
    for row in csvreader:
      nodename=row[0]
      servername=row[1]
      id=AdminConfig.getid('/Node:'+nodename+'/Server:'+servername+'/')
      ProcessID = AdminConfig.list('Cookie',id)
      print nodename + servername
      print AdminConfig.showAttribute(ProcessID,'name')
      print AdminConfig.showAttribute(ProcessID,'secure')
      print AdminConfig.showAttribute(ProcessID,'httpOnly')

設定変更していることを確認する。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?